Priority: Not Evaluated
Affects Version/s: 4.8.4, 5.0.1
Component/s: Image formats
Environment:Gentoo Linux with dev-qt/qtgui-4.8.4-r1, dev-qt/qtgui-5.0.1 installed. The BMP is from the game Capsized shipped with the humble bundle 8. The first version only contains that version of BMP.
gcc (Gentoo 4.6.3 p1.13, pie-0.5.2) 4.6.3
This example application with that bitmap raises an floating point exception during QImage::read() in read_dib_body().
#0 0x00007ffff7314cb8 in read_dib_body (s=..., bi=..., offset=138, startpos=0, image=...) at image/qbmphandler.cpp:322
#1 0x00007ffff731593a in QBmpHandler::read (this=0x67c1c0, image=0x7fffffffd710) at image/qbmphandler.cpp:770
#2 0x00007ffff72eaab6 in QImageReader::read (this=0x7fffffffd780, image=0x7fffffffd710) at image/qimagereader.cpp:1205
#3 0x00007ffff72eb0bf in QImageReader::read (this=0x7fffffffd780) at image/qimagereader.cpp:1155
#4 0x00007ffff72df2fc in QImage::load (this=0x7fffffffd7f0, fileName=..., format=<optimized out>) at image/qimage.cpp:5094
#5 0x00007ffff72df410 in QImage::QImage (this=0x7fffffffd7f0, fileName=<optimized out>, format=0x0) at image/qimage.cpp:1030
#6 0x00000000004005d3 in main ()
The problems seems here, that red_mask is 0xff000000 and therefor red_shift is 24. This results in (red_mask >> red_shift) beeing 0xff. I pressume that (red_mask >> red_shift) + 1 gets to 0 (only 8 bit data type here?) resulting in a division by 0.
It seems to be fixed in qt-5.1.0 beta1.