Merge pull request #8398 from PavlNekrasov/fix/null-check-before-dereference-imIn

This commit is contained in:
Hugo van Kemenade 2024-09-20 12:19:36 +03:00 committed by GitHub
commit b557876ec3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1035,6 +1035,10 @@ ImagingTransformAffine(
double xx, yy; double xx, yy;
double xo, yo; double xo, yo;
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
return (Imaging)ImagingError_ModeError();
}
if (filterid || imIn->type == IMAGING_TYPE_SPECIAL) { if (filterid || imIn->type == IMAGING_TYPE_SPECIAL) {
return ImagingGenericTransform( return ImagingGenericTransform(
imOut, imIn, x0, y0, x1, y1, affine_transform, a, filterid, fill imOut, imIn, x0, y0, x1, y1, affine_transform, a, filterid, fill
@ -1046,10 +1050,6 @@ ImagingTransformAffine(
return ImagingScaleAffine(imOut, imIn, x0, y0, x1, y1, a, fill); return ImagingScaleAffine(imOut, imIn, x0, y0, x1, y1, a, fill);
} }
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
return (Imaging)ImagingError_ModeError();
}
if (x0 < 0) { if (x0 < 0) {
x0 = 0; x0 = 0;
} }