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

crash in QRasterPaintEnginePrivate::blitImage

    XMLWordPrintable

Details

    • All
    • 9fbce8d5cbcc9d8d255328d6ec040db0510ca289 (qt/qtbase/5.12)

    Description

      Even if the position pointer gets high x or y values it shouldn't crash.

      #include <QApplication>
      #include <QGraphicsPixmapItem>
      #include <QGraphicsView>
      #include <QPushButton>
      
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QImage image(10, 10, QImage::Format_ARGB32);
          image.fill(QColor(Qt::darkBlue));
      
      
          QGraphicsPixmapItem *item = new QGraphicsPixmapItem(QPixmap::fromImage(image));
          item->setX(1);
      
          QGraphicsScene scene(1,1,1,1);
          scene.setItemIndexMethod(QGraphicsScene::NoIndex);
          scene.addItem(item);
      
          QGraphicsView view(&scene);
          view.show();
      
      
          QPushButton button("crash");
      
          QObject::connect(&button, &QPushButton::clicked, [item](){
              item->setX(std::numeric_limits<int>::max());
          });
      
          button.show();
      
          return a.exec();
      }
      
      
      1   memcmp                                                 VCRUNTIME140D                0x7ffbd08016ee 
      2   QRasterPaintEnginePrivate::blitImage                   qpaintengine_raster.cpp 1125 0x7ffb69c719b9 
      3   QRasterPaintEngine::drawImage                          qpaintengine_raster.cpp 2240 0x7ffb69c672e0 
      4   QRasterPaintEngine::drawPixmap                         qpaintengine_raster.cpp 2128 0x7ffb69c66601 
      5   QPainter::drawPixmap                                   qpainter.cpp            5079 0x7ffb69c8faac 
      6   QGraphicsPixmapItem::paint                             qgraphicsitem.cpp       9831 0x7ffb6bda075f 
      7   QGraphicsScenePrivate::draw                            qgraphicsscene.cpp      4975 0x7ffb6bdf8956 
      8   QGraphicsScenePrivate::drawSubtreeRecursive            qgraphicsscene.cpp      4869 0x7ffb6bdf824a 
      9   QGraphicsScenePrivate::drawItems                       qgraphicsscene.cpp      4728 0x7ffb6bdf7435 
      10  QGraphicsView::paintEvent                              qgraphicsview.cpp       3534 0x7ffb6be412da 
      11  QWidget::event                                         qwidget.cpp             9044 0x7ffb6b82bd96 
      12  QFrame::event                                          qframe.cpp              550  0x7ffb6b99c576 
      13  QAbstractScrollArea::viewportEvent                     qabstractscrollarea.cpp 1221 0x7ffb6b99fa8c 
      14  QGraphicsView::viewportEvent                           qgraphicsview.cpp       2970 0x7ffb6be3e95b 
      15  QAbstractScrollAreaPrivate::viewportEvent              qabstractscrollarea_p.h 113  0x7ffb6b7b9cdf 
      16  QAbstractScrollAreaFilter::eventFilter                 qabstractscrollarea_p.h 129  0x7ffb6b9a5197 
      17  QCoreApplicationPrivate::sendThroughObjectEventFilters qcoreapplication.cpp    1187 0x7ffb6aa8b0c2 
      18  QApplicationPrivate::notify_helper                     qapplication.cpp        3744 0x7ffb6b7c63ad 
      19  QApplication::notify                                   qapplication.cpp        3703 0x7ffb6b7c39c8 
      20  QCoreApplication::notifyInternal2                      qcoreapplication.cpp    1061 0x7ffb6aa8a0d0 
      ... <More>                                                                                             
      
      

      Attachments

        Issue Links

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

          Activity

            People

              allan.jensen Allan Sandfeld Jensen
              tjenssen Tim Jenssen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes