mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
BUG fix: '' in image mode no longer causes a crash
This commit is contained in:
parent
851aa210df
commit
3ffcd9770c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user