summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2010-06-16 23:17:55 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-06-16 23:24:24 (GMT)
commit6dffaee6ab0bbeddd9e0cb16ff4545c3cb09bfe9 (patch)
tree2da61b76a86f4a467a4b4e54c2041de4c36ef159
parentcae83b15d35c17daebecdc99acf34c55bce1a6c3 (diff)
downloadQt-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.cpp2
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));