Fix potential overflow in gtStripContig()

(w + w) might not fit in int32 if too large.
This commit is contained in:
skal 2020-11-12 15:41:14 +00:00
parent 2e822691d7
commit ce70d17ee6

View File

@ -936,6 +936,10 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
flip = setorientation(img);
if (flip & FLIP_VERTICALLY) {
if ( w > 0x7FFFFFFFu ) {
TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Width overflow");
return (0);
}
y = h - 1;
toskew = -(int32)(w + w);
} else {