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

Insufficient qreal validation in ./src/gui/painting/qpdf.cpp produces broken PDF with large coordinates

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.6.1, 6.7.0 FF
    • 5.15.7, 6.4.2
    • GUI: Printing
    • None
    • Linux/X11
    • 888be431d (dev), 696fbf9fc (6.6)

    Description

      When generating PDF files using QPrinter and painting paths with large coordinates (but not NaN), the generated PDF is broken, with coordinates that look like 3209191894 421./,),(- l , which breaks the generated PDF (with unmatched parenthesis).

      All versions I had access to are affected. The problem lies in insufficient validation of the qt_real_to_string function in src/gui/painting/qpdf.cpp.

      Running the menu item in the attached program generates 10 PDF files, the last two of which (on my computer) are corrupted to the point that no PDF program can display them. Uncompressing reveals broken coordinates. I've attached one of the broken uncompressed ones.

      Attachments

        For Gerrit Dashboard: QTBUG-117740
        # Subject Branch Project Status CR V

        Activity

          People

            vgt Eirik Aavitsland
            vincent.fourmond Vincent Fourmond
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes