From: Ivailo Monev Date: Fri, 6 Aug 2021 13:16:43 +0000 (+0300) Subject: use QSTACKARRAY() macro in qt_addBitmapToPath() function X-Git-Tag: 4.12.0~2045 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=be8f5ada833cb4031c32d50d66b9662f24e5dc06;p=kde%2FKatie.git use QSTACKARRAY() macro in qt_addBitmapToPath() function Signed-off-by: Ivailo Monev --- diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index 9c0368cba..ad859ead5 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -30,6 +30,7 @@ #include "qendian.h" #include "qharfbuzz_p.h" #include "qdrawhelper_p.h" +#include "qcorecommon_p.h" QT_BEGIN_NAMESPACE @@ -459,7 +460,7 @@ static void collectSingleContour(qreal x0, qreal y0, uint *grid, int x, int y, i Q_GUI_EXPORT void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path) { - uint *grid = new uint[(w+1)*(h+1)]; + QSTACKARRAY(uint, grid, (w+1)*(h+1)); // set up edges for (int y = 0; y <= h; ++y) { for (int x = 0; x <= w; ++x) { @@ -489,7 +490,6 @@ Q_GUI_EXPORT void qt_addBitmapToPath(qreal x0, qreal y0, const uchar *image_data collectSingleContour(x0, y0, grid, x, y, w, h, path); } } - delete [] grid; } #undef GRID