Fix bad_alloc exception when loading bmp images with negative height (#1341)
The 'long' type can be 32 bits or 64 bits depending on what compiler you are using (LLP64 vs LP64). If the long type is 64 bits the biHeight variable will receive a very big number when the bmp image height is negative, causing a std::bad_alloc exception when calling the 'image.set_size' method.
Showing
Please
register
or
sign in
to comment