We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3baedf2 + 921a470 commit c9ac097Copy full SHA for c9ac097
src/_imaging.c
@@ -2459,7 +2459,6 @@ _merge(PyObject *self, PyObject *args) {
2459
2460
static PyObject *
2461
_split(ImagingObject *self) {
2462
- int fails = 0;
2463
Py_ssize_t i;
2464
PyObject *list;
2465
PyObject *imaging_object;
@@ -2473,14 +2472,12 @@ _split(ImagingObject *self) {
2473
2472
for (i = 0; i < self->image->bands; i++) {
2474
imaging_object = PyImagingNew(bands[i]);
2475
if (!imaging_object) {
2476
- fails += 1;
+ Py_DECREF(list);
+ list = NULL;
2477
+ break;
2478
}
2479
PyTuple_SET_ITEM(list, i, imaging_object);
2480
- if (fails) {
2481
- Py_DECREF(list);
2482
- list = NULL;
2483
- }
2484
return list;
2485
2486
0 commit comments