mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 19:06:18 +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;
|
im->linesize = xsize * 4;
|
||||||
|
|
||||||
} else if (strcmp(mode, "RGBa") == 0) {
|
} else if (strcmp(mode, "RGBa") == 0) {
|
||||||
/* EXPERIMENTAL */
|
|
||||||
/* 32-bit true colour images with premultiplied alpha */
|
/* 32-bit true colour images with premultiplied alpha */
|
||||||
im->bands = im->pixelsize = 4;
|
im->bands = im->pixelsize = 4;
|
||||||
im->linesize = xsize * 4;
|
im->linesize = xsize * 4;
|
||||||
|
@ -423,6 +422,10 @@ ImagingNewBlock(const char* mode, int xsize, int ysize)
|
||||||
{
|
{
|
||||||
Imaging im;
|
Imaging im;
|
||||||
|
|
||||||
|
if (xsize < 0 || ysize < 0) {
|
||||||
|
return (Imaging) ImagingError_ValueError("bad image size");
|
||||||
|
}
|
||||||
|
|
||||||
im = ImagingNewPrologue(mode, xsize, ysize);
|
im = ImagingNewPrologue(mode, xsize, ysize);
|
||||||
if ( ! im)
|
if ( ! im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user