mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Check image value before use
This commit is contained in:
parent
b557876ec3
commit
e57da68190
|
@ -791,15 +791,15 @@ ImagingGenericTransform(
|
||||||
char *out;
|
char *out;
|
||||||
double xx, yy;
|
double xx, yy;
|
||||||
|
|
||||||
|
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
|
||||||
|
return (Imaging)ImagingError_ModeError();
|
||||||
|
}
|
||||||
|
|
||||||
ImagingTransformFilter filter = getfilter(imIn, filterid);
|
ImagingTransformFilter filter = getfilter(imIn, filterid);
|
||||||
if (!filter) {
|
if (!filter) {
|
||||||
return (Imaging)ImagingError_ValueError("bad filter number");
|
return (Imaging)ImagingError_ValueError("bad filter number");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
|
|
||||||
return (Imaging)ImagingError_ModeError();
|
|
||||||
}
|
|
||||||
|
|
||||||
ImagingCopyPalette(imOut, imIn);
|
ImagingCopyPalette(imOut, imIn);
|
||||||
|
|
||||||
ImagingSectionEnter(&cookie);
|
ImagingSectionEnter(&cookie);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user