If you build an executable using lodepng with -g -Og -fsanitize=address,undefined -fsanitize-no-recover=all in CFLAGS and try to load this image file, the program will abort with the following output:
lodepng.c:1370:28: runtime error: applying zero offset to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lodepng.c:1370:28
The fix is to check for a NULL pointer before trying to do calculations with it.
If you build an executable using lodepng with
-g -Og -fsanitize=address,undefined -fsanitize-no-recover=all
in CFLAGS and try to load this image file, the program will abort with the following output:The fix is to check for a NULL pointer before trying to do calculations with it.