dbohdan / hicolor

🎨 Convert images to 15/16-bit RGB color with dithering
MIT License
194 stars 5 forks source link

Lack of PNG format verification #2

Closed iosifache closed 1 year ago

iosifache commented 2 years ago

As the cute_png.h library is used to load and parse PNG files, the returned image is not verified. This could cause the program's functionality to be disrupted.

An example I encountered was when the PNG headers stored excessive values for the image's height and width (despite the fact that the pixels are not stored in the data section of the format). This causes the malloc from the function cp_to_rgb to return NULL and, as a result of the pointer dereferencing below, the program will generate a SIGSERV and stop working.

ghost commented 2 years ago

how did you get this software to work.

iosifache commented 2 years ago

@tax-evasion6967, just following the README.md for building the executable on Linux and running it.

dbohdan commented 1 year ago

https://github.com/RandyGaul/cute_headers/issues/335