summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-15 11:52:55 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-15 11:53:50 (GMT)
commitb8058b594534050909cf0dfc6b4be2a1b6a4dc1b (patch)
treed73eaa9a07f2d777e1f5813d1915b794c651ed59 /src/gui/painting/qpaintengine_raster.cpp
parent7f0b4d3b99bb767724a09234768104e18aa52b0e (diff)
downloadQt-b8058b594534050909cf0dfc6b4be2a1b6a4dc1b.zip
Qt-b8058b594534050909cf0dfc6b4be2a1b6a4dc1b.tar.gz
Qt-b8058b594534050909cf0dfc6b4be2a1b6a4dc1b.tar.bz2
Prevented QClipData related crashes.
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 87e9283..0e8f50a 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4344,6 +4344,7 @@ void QClipData::initialize()
m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
m_spans = (QSpan *)malloc(clipSpanHeight*sizeof(QSpan));
+ allocated = clipSpanHeight;
if (hasRectClip) {
int y = 0;
@@ -4388,6 +4389,7 @@ void QClipData::initialize()
int y = 0;
int firstInBand = 0;
+ count = 0;
while (firstInBand < numRects) {
const int currMinY = rects.at(firstInBand).y();
const int currMaxY = currMinY + rects.at(firstInBand).height();
@@ -4502,7 +4504,7 @@ void QClipData::setClipRect(const QRect &rect)
ymax = qMin(rect.y() + rect.height(), clipSpanHeight);
if (m_spans) {
- delete m_spans;
+ free(m_spans);
m_spans = 0;
}
@@ -4532,7 +4534,7 @@ void QClipData::setClipRegion(const QRegion &region)
}
if (m_spans) {
- delete m_spans;
+ free(m_spans);
m_spans = 0;
}