wxWidgets/tests/image/8bpp-colorsused-negative.bmp
David Costanzo 20208cc81f Fix loading bitmaps with malformed biClrUsed field
Stop throwing std::bad_alloc when BMP has large/negative biClrUsed by
checking that biClrUsed has a reasonable value before attempting to
allocate however much memory it indicates.

Add unit tests showing the loading such invalid bitmaps now correctly
returns an error rather than throwing an exception.

Closes https://github.com/wxWidgets/wxWidgets/pull/2583

Closes #19295.
2021-11-06 16:12:04 +01:00

75 KiB