From b674d0d5cc74409d15741a707bd91d2cde8c22bd Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 12 Aug 2016 16:08:15 +0200 Subject: Fix rendering error in some animated gifs The code for handling of the rarely used "restore to previous" frame disposal option would mistakenly clear the entire existing frame. It looks like this was a copy/paste mistake in the code; the intention obviously was to clear the newly created backingstore instead. This fixes the rendering of http://media1.giphy.com/media/9Jevgp0CgvAnm/giphy.gif Task-number: QTBUG-55141 Change-Id: I4d344b7733edd62346656154e215c21727f9b6bb Reviewed-by: Lars Knoll --- src/gui/image/qgifhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qgifhandler.cpp b/src/gui/image/qgifhandler.cpp index 9c748c0373..4197d7e959 100644 --- a/src/gui/image/qgifhandler.cpp +++ b/src/gui/image/qgifhandler.cpp @@ -409,7 +409,7 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length, backingstore = QImage(qMax(backingstore.width(), w), qMax(backingstore.height(), h), QImage::Format_RGB32); - memset(bits, 0, image->byteCount()); + memset(backingstore.bits(), 0, backingstore.byteCount()); } const int dest_bpl = backingstore.bytesPerLine(); unsigned char *dest_data = backingstore.bits(); -- cgit v1.2.3 From 0d994523394c74911b32f29036b5bc13d9f5122f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 17 Aug 2016 12:42:19 +0200 Subject: Protect QImage::convertToFormat against null QImage QImage may have a null d-pointer, and convertToFormat_helper was the only method not protected against it. Change-Id: Ibfe5b139e3922f2a0c8284c6ae1932c2150efc66 Reviewed-by: Marc Mutz --- src/gui/image/qimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index ee77a32b86..17d3c02e36 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2117,7 +2117,7 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format, */ QImage QImage::convertToFormat(Format format, const QVector &colorTable, Qt::ImageConversionFlags flags) const { - if (d->format == format) + if (!d || d->format == format) return *this; if (format <= QImage::Format_Indexed8 && depth() == 32) { -- cgit v1.2.3 From 3b3780748ba76ddee447d06bc6e7a5f753ee6f42 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 19 Aug 2016 12:59:09 +0200 Subject: QXpmHandler: remove 657 unneeded relocations Same change as in QColor (d38f86e50b01c6dd60f5a97355031e08d6a47d18), but much more dramatic effect, due to 5x more elements in the array: relocs: -657 text: -3416B data: -10528B (optimized GCC 6.1 Linux AMD64 build) Change-Id: Ia266ab68f2d309743374ac2034a69f58bf556adf Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/image/qxpmhandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/image') diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index fbce78eb74..b673ae5b33 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -74,7 +74,7 @@ static const int xpmRgbTblSize = 657; static const struct XPMRGBData { uint value; - const char *name; + const char name[21]; } xpmRgbTbl[] = { { QRGB(240,248,255), "aliceblue" }, { QRGB(250,235,215), "antiquewhite" }, -- cgit v1.2.3