Skip to content

Commit

Permalink
Check image value before use
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 20, 2024
1 parent b557876 commit e57da68
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 @@ -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);
Expand Down

0 comments on commit e57da68

Please sign in to comment.