stb
stb copied to clipboard
[stb_image] image too large check is wrong
stb_image being used on a STM32 ARM Cortex-M7 micro controller. Firmware built using gcc.
https://github.com/nothings/stb/blob/013ac3beddff3dbffafd5177e7972067cd2b5083/stb_image.h#L5121
stb_image.h line 5121 checking size of a PNG image returns with the error "Image too large to decode", when it should not. In my test case, the PNG is 8bpp, RGBA, 300 x 100 pixels. I have step-debugged the code, img_x, img_y, img_n are correct (300, 100, 4 respectively).