From 6dffaee6ab0bbeddd9e0cb16ff4545c3cb09bfe9 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 17 Jun 2010 01:17:55 +0200 Subject: 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 --- src/gui/text/qfontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v0.12