GreycLab / CImg

The CImg Library is a small and open-source C++ toolkit for image processing
http://cimg.eu
Other
1.48k stars 282 forks source link

add global hardening against RAM exhaustions in safe_size #348

Closed 7unn3l closed 2 years ago

7unn3l commented 2 years ago

This pull request seeks to harden CImg against RAM exhaustions. cimg_max_file_size has been renamend to cimg_max_buf_size and a check was implemented inside safe_size to prevent sizes that are too large. This gives the user of the lib more control over possible resource consumption. Everywhere safe_size is used, cimg now checks if this size is within the user specified limits.