From 5ef4e0ed0c107c8ac0f4bf26c0fe986ab6e984fb Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 2 Apr 2014 13:54:14 +0200 Subject: QPainter: Fix a hard to trigger null dereference in QPainterPrivate::drawTextItem. Done-with: Mohammed Hassan Change-Id: I24c724d24346fb5be8c4a66d68a11d51be5ad5f2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/painting/qpainter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index fe5fc051df..a3b1f07c69 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6416,6 +6416,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText continue; + multi->ensureEngineAt(which); QTextItemInt ti2 = ti.midItem(multi->engine(which), start, end - start); ti2.width = 0; // set the high byte to zero and calc the width @@ -6443,6 +6444,7 @@ void QPainterPrivate::drawTextItem(const QPointF &p, const QTextItem &_ti, QText which = e; } + multi->ensureEngineAt(which); QTextItemInt ti2 = ti.midItem(multi->engine(which), start, end - start); ti2.width = 0; // set the high byte to zero and calc the width -- cgit v1.2.3