xiaozhuai / imageinfo

Free Palestine🇵🇸🇵🇸🇵🇸Cross platform super fast single header c++ library to get image size and format without loading/decoding. Support avif, bmp, cur, dds, gif, hdr (pic), heic (heif), icns, ico, j2k, jp2, jpeg (jpg), jpx, ktx, png, psd, qoi, tga, tiff (tif), webp ...
MIT License
107 stars 26 forks source link

Fix buffer overflow issues in AVIF/HEIC parsing #13

Closed chan233 closed 1 month ago

chan233 commented 1 month ago
- Added checks to ensure buffer reads do not exceed the allocated size.
- Verified minimum and maximum box sizes to prevent invalid data handling.
- Ensured presence of 'ftyp' and 'meta' headers before parsing.
- Improved error handling to prevent heap overflow.

This is a test sample that causes a heap overflow: crash_avif_2.zip