Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-31755

QImage: floating point exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • 4.8.5, 5.1.0
    • 4.8.4, 5.0.1
    • Image formats
    • None

    Description

      This example application with that bitmap raises an floating point exception during QImage::read() in read_dib_body().
      Backtrace:
      #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.

      Attachments

        1. Capsized.bmp
          1.00 MB
        2. qimage.cpp
          0.1 kB

        Activity

          People

            vgt Eirik Aavitsland
            astein Alexander Stein
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: