Skip to content

jpeg: Limit the memory size when loading image data

Emmanuele Bassi requested to merge ebassi/issue-205 into master

Specially crafted JPEG images may lead to a crash when their size is too large; in the most benign of cases, the OS might terminate the process after it tries to allocate all the memory in the world.

We can tell libjpeg to limit the size of the memory pool when loading, to avoid this kind of result. For the time being, 100 MB seems like a good threshold.

Original patch by: Sam Ezeh sam.z.ezeh@gmail.com

Fixes: #205 (closed)

Merge request reports