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

QImageReader.size() crashes or aborts with SVG

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.5.0, 4.6.1
    • SVG Support
    • None
    • Ubuntu-Intel / Qt 4.5.0
      Scratchbox-Intel / Qt 4.6.1 or Qt 4.6.3
    • 13732b74e07fe10e95f2601f6cf2d0be78467eaa

    Description

      I want to check the recommended aspect ratio of a SVG file in a time-critical situation, so I write the following example program:

      #include <QImageReader>
      #include <QDebug>
      
      int main(int argc, char **argv)
      {
          QImageReader reader("Suojatie.svg");
      
          qDebug() << reader.size();
      }
      

      I expect it to return any QSize with a reasonable aspect ratio. However, it crashes (Ubuntu) or aborts (Scratchbox). The abort message is:

      ASSERT: "!m_nodes.isEmpty()" in file qsvghandler.cpp, line 3644
      Aborted (core dumped)

      I have attached two SVG's (from Wikipedia) which both cause this behavior.

      Attachments

        1. Finland.svg
          50 kB
        2. Suojatie.svg
          25 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kkalland Kim Motoyoshi Kalland (Inactive)
            jusrauti Jussi Rautio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes