Skip to content

Commit

Permalink
Merge pull request #8398 from PavlNekrasov/fix/null-check-before-dere…
Browse files Browse the repository at this point in the history
…ference-imIn
  • Loading branch information
hugovk committed Sep 20, 2024
2 parents 59a155b + 9424b1a commit b557876
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libImaging/Geometry.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,10 @@ ImagingTransformAffine(
double xx, yy;
double xo, yo;

if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
return (Imaging)ImagingError_ModeError();
}

if (filterid || imIn->type == IMAGING_TYPE_SPECIAL) {
return ImagingGenericTransform(
imOut, imIn, x0, y0, x1, y1, affine_transform, a, filterid, fill
Expand All @@ -1046,10 +1050,6 @@ ImagingTransformAffine(
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) {
x0 = 0;
}
Expand Down

0 comments on commit b557876

Please sign in to comment.