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

QImage hangsup on loading some .BMP files.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.6.2
    • 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.6.0, 4.6.1
    • Image formats
    • None
    • Linux -- kubuntu 9.04, gcc 4.3-3, architecture i386 (ia32)
    • 0a3ce6fa04ed2b085fe72b89d302a3a5f9e82948

    Description

      I try to load this image from file by the QImage constructor and by the QImageReader class method "read" and it cause program to hangup.

      Possible cause of this is code in qbmphandler.cpp on lines 268-280 (function read_dib_body(QDataStream&, const BMP_INFOHDR&, int, int, QImage& ) ), where you calling calc_shift() function with parameter mask, that was readed from file and may be 0.
      Then in calc_shift function at line 147 you use mask in loop condition:

      while (!(mask & 1))

      { result++; mask >>= 1; }

      and if mask == 0 loop condition will newer become 0.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            danil Danil Ishkov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes