Closed randy408 closed 4 years ago
Fuzzing helps find such security bugs. LodePNG is being fuzzed with oss-fuzz here:
https://github.com/google/oss-fuzz/tree/master/projects/lodepng
Bugs found by fuzzing have been fixed in the past, and the fuzzer has not found new bugs for months, as of typing this.
You can judge based on this information and the above oss-fuzz link.
To answer the running out of memory question:
lodepng will handle out of memory errors, it'll return an error code.
by default, lodepng will try to allocate whatever is needed without limits, if an image is 1 billion by 1 billion pixels it would try to allocate that (but not on a 32-bit machine since this would overflow there). You could use lodepng_inspect beforehand to get the width and height of the image and reject too large images.
Thanks for the answers.
Given reasonable image width- and height limits, is it capable of decoding arbitrary files without crashing, running out of memory or taking forever?