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

QImageReader.size() crashes or aborts with SVG

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important 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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes