diff options
author | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-06-16 23:17:55 (GMT) |
---|---|---|
committer | Benjamin Poulain <benjamin.poulain@nokia.com> | 2010-06-16 23:24:24 (GMT) |
commit | 6dffaee6ab0bbeddd9e0cb16ff4545c3cb09bfe9 (patch) | |
tree | 2da61b76a86f4a467a4b4e54c2041de4c36ef159 | |
parent | cae83b15d35c17daebecdc99acf34c55bce1a6c3 (diff) | |
download | Qt-6dffaee6ab0bbeddd9e0cb16ff4545c3cb09bfe9.zip Qt-6dffaee6ab0bbeddd9e0cb16ff4545c3cb09bfe9.tar.gz Qt-6dffaee6ab0bbeddd9e0cb16ff4545c3cb09bfe9.tar.bz2 |
Allocate the memory for QtFontSize when count > 1
This fix a regression introduced by
71ba2b0973d291e991e1498c266e69d6640c8531.
In the case count >= 1 && count < 8, no memory is allocated.
Reviewed-by: Andreas Kling
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 4c058ce..139139f 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -289,7 +289,7 @@ QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add) QtFontSize *newPixelSizes = (QtFontSize *)malloc(sizeof(QtFontSize)); Q_CHECK_PTR(newPixelSizes); pixelSizes = newPixelSizes; - } else if (!(count % 8)) { + } else if (!(count % 8) || count == 1) { QtFontSize *newPixelSizes = (QtFontSize *) realloc(pixelSizes, (((count+8) >> 3) << 3) * sizeof(QtFontSize)); |