summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2010-02-10 09:05:51 (GMT)
committeraavit <qt-info@nokia.com>2010-02-10 09:05:51 (GMT)
commit6f155d010b6dd5ae3c04e62b3a29f8c0ed9f0a36 (patch)
tree4ac75182e5e43de63c9f83740f0fb06c0cf7e496 /src/gui/image
parent2613eb1b11fb9172a0bc766d561289132c56e832 (diff)
downloadQt-6f155d010b6dd5ae3c04e62b3a29f8c0ed9f0a36.zip
Qt-6f155d010b6dd5ae3c04e62b3a29f8c0ed9f0a36.tar.gz
Qt-6f155d010b6dd5ae3c04e62b3a29f8c0ed9f0a36.tar.bz2
Workaround for a certain functionally challenged compiler
Reviewed-by: Trond
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpnghandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp
index bba54b9..dd31834 100644
--- a/src/gui/image/qpnghandler.cpp
+++ b/src/gui/image/qpnghandler.cpp
@@ -767,9 +767,9 @@ bool Q_INTERNAL_WIN_NO_THROW QPNGImageWriter::writeImage(const QImage& image_in,
if (image.colorCount()) {
// Paletted
- int num_palette = image.colorCount();
- png_color palette[num_palette];
- png_byte trans[num_palette];
+ int num_palette = qMin(256, image.colorCount());
+ png_color palette[256];
+ png_byte trans[256];
int num_trans = 0;
for (int i=0; i<num_palette; i++) {
QRgb rgba=image.color(i);