From b674d0d5cc74409d15741a707bd91d2cde8c22bd Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 12 Aug 2016 16:08:15 +0200 Subject: [PATCH] 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(-) 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();