Limit dimensions of all image loaders to 23000x23000

This commit is contained in:
sfan5
2021-09-30 16:40:41 +02:00
parent 594de99153
commit dbd39120e7
5 changed files with 24 additions and 2 deletions

View File

@ -221,8 +221,8 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const
cinfo.output_gamma=2.2;
cinfo.do_fancy_upsampling=FALSE;
// reject unreasonable sizes (4 * 32000 * 32000 is just under U32_MAX)
if (cinfo.image_width > 32000 || cinfo.image_height > 32000)
// reject unreasonable sizes
if (!checkImageDimensions(cinfo.image_width, cinfo.image_height))
longjmp(jerr.setjmp_buffer, 1);
// Start decompressor