Details
-
Bug
-
Resolution: Done
-
P0: Blocker
-
4.6.0
-
None
-
a48b8e3c8c05384b27fcdde4ac27b8b8866c36c2
Description
Raster paint engine crashes on certain drawImage calls. Reproducible by:
{ QPixmap src(79,79); src.fill(Qt::transparent); QImage pm(200,200,QImage::Format_RGB32); QPainter p(&pm); p.setTransform(QTransform(-1,0,0,-1,173.5,153.5)); qDrawBorderPixmap(&p, QRect(0,0,75,105), QMargins(39,39,39,39), src, QRect(0,0,79,79), QMargins(39,39,39,39), QTileRules(Qt::StretchTile,Qt::StretchTile), 0); }
SegFaults on Linux/X11
(added to tst_qpainter.cpp)
I would assume it's possible to produce the crash by a more direct call to drawImage, the above is just the minimal reduction of my real case (eg. QML Snake game will crash with this after a while).
Backtrace:
#0 0xb759af40 in qt_scale_image_32bit<Blend_ARGB32_on_ARGB32_SourceAlpha> ( destPixels=0x811b588 "\n*Entry.highlightBackground:\t#ffffff\n*Entry.highlightColor:\t#000000\n*Entry.selectBackground:\t#447bcd\n*Entry.selectForeground:\t#ffffff\n*Form.background:\t#eeeeee\n*Form.foreground:\t#000000\n*Frame.activeB"..., dbpl=800, srcPixels=0x8153270 "", sbpl=316, targetRect=@0xbfb806e0, srcRect=@0xbfb81004, clip=@0x80c3374, blender={<No data fields>}) at /home/wallison/qt/kinetic/src/gui/painting/qblendfunctions.cpp:739 #1 0xb758a020 in qt_scale_image_argb32_on_argb32 ( destPixels=0x811b588 "\n*Entry.highlightBackground:\t#ffffff\n*Entry.highlightColor:\t#000000\n*Entry.selectBackground:\t#447bcd\n*Entry.selectForeground:\t#ffffff\n*Form.background:\t#eeeeee\n*Form.foreground:\t#000000\n*Frame.activeB"..., dbpl=800, srcPixels=0x8153270 "", sbpl=316, targetRect=@0xbfb806e0, sourceRect=@0xbfb81004, clip=@0x80c3374, const_alpha=256) at /home/wallison/qt/kinetic/src/gui/painting/qblendfunctions.cpp:790 #2 0xb766f9a7 in QRasterPaintEngine::drawImage (this=0x80cab68, r=@0xbfb80ba8, img=@0xbfb8094c, sr=@0xbfb81004) at /home/wallison/qt/kinetic/src/gui/painting/qpaintengine_raster.cpp:2616 #3 0xb76733da in QRasterPaintEngine::drawPixmap (this=0x80cab68, r=@0xbfb80ba8, pixmap=@0xbfb81e08, sr=@0xbfb81004) at /home/wallison/qt/kinetic/src/gui/painting/qpaintengine_raster.cpp:2448 #4 0xb75c8acc in QPaintEngineEx::drawPixmaps (this=0x80cab68, drawingData=0xbfb80ff4, dataCount=6, pixmap=@0xbfb81e08) at /home/wallison/qt/kinetic/src/gui/painting/qpaintengineex.cpp:969 #5 0xb75ae99b in qDrawPixmaps (painter=0xbfb81df8, drawingData=0xbfb80ff4, dataCount=6, pixmap=@0xbfb81e08, hints= {i = -1078452996}) at /home/wallison/qt/kinetic/src/gui/painting/qdrawutil.cpp:1357 #6 0xb75b0f21 in qDrawBorderPixmap (painter=0xbfb81df8, targetRect=@0xbfb81eb0, targetMargins=@0xbfb81ea0, pixmap=@0xbfb81e08, sourceRect=@0xbfb81e90, sourceMargins=@0xbfb81e80, rules=@0xbfb81e78, hints={i = -1078452620}) at /home/wallison/qt/kinetic/src/gui/painting/qdrawutil.cpp:1317 #7 0x080729f7 in tst_QPainter::drawBorderPixmap (this=0xbfb82bec) at /home/wallison/qt/kinetic/tests/auto/qpainter/tst_qpainter.cpp:984