Skip to content

Commit b557876

Browse files
authored
Merge pull request #8398 from PavlNekrasov/fix/null-check-before-dereference-imIn
2 parents 59a155b + 9424b1a commit b557876

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libImaging/Geometry.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,6 +1035,10 @@ ImagingTransformAffine(
10351035
double xx, yy;
10361036
double xo, yo;
10371037

1038+
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
1039+
return (Imaging)ImagingError_ModeError();
1040+
}
1041+
10381042
if (filterid || imIn->type == IMAGING_TYPE_SPECIAL) {
10391043
return ImagingGenericTransform(
10401044
imOut, imIn, x0, y0, x1, y1, affine_transform, a, filterid, fill
@@ -1046,10 +1050,6 @@ ImagingTransformAffine(
10461050
return ImagingScaleAffine(imOut, imIn, x0, y0, x1, y1, a, fill);
10471051
}
10481052

1049-
if (!imOut || !imIn || strcmp(imIn->mode, imOut->mode) != 0) {
1050-
return (Imaging)ImagingError_ModeError();
1051-
}
1052-
10531053
if (x0 < 0) {
10541054
x0 = 0;
10551055
}

0 commit comments

Comments
 (0)