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

Crash when creating QRegion from "interesting" QPolygon

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • 4.6.3
    • 3.x
    • GUI: Painting
    • None
    • ff9f3fc24c57254b150c1afba2e5883da8ed2b83

      Simple testcase
      #include <QRegion>
      #include <QPolygon>
      
      int main(int argc, char **argv)
      {
          QPolygon polygon;
      
          polygon << QPoint(100, 0);
          polygon << QPoint(-10000000, 2);
          polygon << QPoint(100, 0);
      
          QRegion region(polygon);
      
          return 0;
      }
      
      Valgrind output
      ==19930== Invalid read of size 4
      ==19930==    at 0x527E707: InsertionSort(_EdgeTableEntry*) (qregion.cpp:3406)
      ==19930==    by 0x527F73F: PolygonRegion(QPoint const*, int, int) (qregion.cpp:3676)
      ==19930==    by 0x52804F9: QRegion::QRegion(QPolygon const&, Qt::FillRule) (qregion.cpp:3871)
      ==19930==    by 0x400E44: main (main.cpp:12)
      ==19930==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
      

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

            rodal Samuel Rødal
            akling Andreas Kling (closed Nokia identity) (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes