mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-27 10:26:19 +03:00
Add params check for ImagingNewBlock
This commit is contained in:
parent
3b5c2c30be
commit
852124d49b
|
@ -173,7 +173,6 @@ ImagingNewPrologueSubtype(const char *mode, int xsize, int ysize, int size)
|
|||
im->linesize = xsize * 4;
|
||||
|
||||
} else if (strcmp(mode, "RGBa") == 0) {
|
||||
/* EXPERIMENTAL */
|
||||
/* 32-bit true colour images with premultiplied alpha */
|
||||
im->bands = im->pixelsize = 4;
|
||||
im->linesize = xsize * 4;
|
||||
|
@ -423,6 +422,10 @@ ImagingNewBlock(const char* mode, int xsize, int ysize)
|
|||
{
|
||||
Imaging im;
|
||||
|
||||
if (xsize < 0 || ysize < 0) {
|
||||
return (Imaging) ImagingError_ValueError("bad image size");
|
||||
}
|
||||
|
||||
im = ImagingNewPrologue(mode, xsize, ysize);
|
||||
if ( ! im)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue
Block a user