BUG fix: '' in image mode no longer causes a crash

This commit is contained in:
Lukasz Kozuchowski 2017-01-29 07:20:44 +01:00
parent 851aa210df
commit 3ffcd9770c

View File

@ -398,6 +398,9 @@ ImagingNew(const char* mode, int xsize, int ysize)
int bytes;
Imaging im;
if (strcmp(mode, "") == 0)
return (Imaging) ImagingError_ValueError("empty mode");
if (strlen(mode) == 1) {
if (mode[0] == 'F' || mode[0] == 'I')
bytes = 4;