summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-09-21 14:23:54 +0200
committerMarc Mutz <marc.mutz@kdab.com>2016-09-22 15:25:18 +0000
commite2e107556dfb843fa0c3dc3e52695b34fdb40ba1 (patch)
treeb1f9fd262dc72c7b386c95c0dd84be905e8f2855 /src
parent622681eb508ddb1bd51a39b6887beddb43218504 (diff)
tst_QGraphicsItem: Fix UB (invalid cast/member call) in prepareGeometryChange()
Found by UBSan: tst_qgraphicsitem.cpp:5066:29: runtime error: downcast of address 0x2afcb006c7f0 which does not point to an object of type 'GeometryChanger' 0x2afcb006c7f0: note: object is of type 'QGraphicsRectItem' 00 00 00 00 d8 64 ca 98 fc 2a 00 00 40 a9 0b b0 fc 2a 00 00 75 65 29 00 00 00 00 00 35 00 00 00 ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QGraphicsRectItem' #0 0x4c5f1c in tst_QGraphicsItem::prepareGeometryChange() tst_qgraphicsitem.cpp:5066 Fix by actually instantiating a GeometryChanger, which incidentally is the pattern used by paint() a few lines below, too. While at it, allocate the item on the stack (as is done in paint()) and create a local QRectF variable to avoid repeating the same magic numbers over and over again. Change-Id: If5a3d56511000a17703d78d7dd1f0ea072b8bc11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions