Check image value before use

This commit is contained in:
Andrew Murray 2024-09-20 19:20:53 +10:00
parent b557876ec3
commit e57da68190

View File

@ -791,15 +791,15 @@ ImagingGenericTransform(
char *out;
double xx, yy;
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
return (Imaging)ImagingError_ModeError();
}
ImagingTransformFilter filter = getfilter(imIn, filterid);
if (!filter) {
return (Imaging)ImagingError_ValueError("bad filter number");
}
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
return (Imaging)ImagingError_ModeError();
}
ImagingCopyPalette(imOut, imIn);
ImagingSectionEnter(&cookie);