summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmapfilter.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-09-17 19:47:56 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2010-09-17 19:58:16 +0200
commitdd14f5ea568ce647638993da90112e71cffc9cc9 (patch)
tree6289ae3951898a7b3d9fc218cb6355a98ac4135c /src/gui/image/qpixmapfilter.cpp
parent4f33dbd5361c0875f39518b762a764478f04dd30 (diff)
Fixed memory corruption issue in qt_blurImage for Indexed8 images.
If transposed was set to 0 we did not check the color depth of the image and ended up with a buffer overflow. Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/image/qpixmapfilter.cpp')
-rw-r--r--src/gui/image/qpixmapfilter.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/image/qpixmapfilter.cpp b/src/gui/image/qpixmapfilter.cpp
index 70770c47ce..26bffcc866 100644
--- a/src/gui/image/qpixmapfilter.cpp
+++ b/src/gui/image/qpixmapfilter.cpp
@@ -764,10 +764,17 @@ void expblur(QImage &img, qreal radius, bool improvedQuality = false, int transp
}
if (transposed == 0) {
- qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()),
- temp.width(), temp.height(), temp.bytesPerLine(),
- reinterpret_cast<quint32*>(img.bits()),
- img.bytesPerLine());
+ if (img.depth() == 8) {
+ qt_memrotate90(reinterpret_cast<const quint8*>(temp.bits()),
+ temp.width(), temp.height(), temp.bytesPerLine(),
+ reinterpret_cast<quint8*>(img.bits()),
+ img.bytesPerLine());
+ } else {
+ qt_memrotate90(reinterpret_cast<const quint32*>(temp.bits()),
+ temp.width(), temp.height(), temp.bytesPerLine(),
+ reinterpret_cast<quint32*>(img.bits()),
+ img.bytesPerLine());
+ }
} else {
img = temp;
}