mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #8398 from PavlNekrasov/fix/null-check-before-dereference-imIn
This commit is contained in:
commit
b557876ec3
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user