QPainter: Fix a hard to trigger null dereference in QPainterPrivate::drawTextItem.

Done-with: Mohammed Hassan <mohammed.hassan@jollamobile.com>
Change-Id: I24c724d24346fb5be8c4a66d68a11d51be5ad5f2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
bb10
Robin Burchell 2014-04-02 13:54:14 +02:00 committed by The Qt Project
parent 78f6d144d6
commit 5ef4e0ed0c
1 changed files with 2 additions and 0 deletions

View File

@ -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