CVE: CVE-2021-40263 Upstream: https://src.fedoraproject.org/rpms/freeimage/raw/rawhide/f/CVE-2021-40263.patch Signed-off-by: Thomas Perale --- diff -rupN a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp --- a/Source/FreeImage/PluginTIFF.cpp +++ b/Source/FreeImage/PluginTIFF.cpp @@ -2090,6 +2090,10 @@ Load(FreeImageIO *io, fi_handle handle, uint32 tileRowSize = (uint32)TIFFTileRowSize(tif); uint32 imageRowSize = (uint32)TIFFScanlineSize(tif); + if (width / tileWidth * tileRowSize * 8 > bitspersample * samplesperpixel * width) { + free(tileBuffer); + throw "Corrupted tiled TIFF file"; + } // In the tiff file the lines are saved from up to down // In a DIB the lines must be saved from down to up