Fix GIF transparency.
authorjei.mayol <jei.mayol@gmail.com>
Thu, 5 Feb 2015 05:31:23 +0000 (21:31 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 5 Feb 2015 05:31:23 +0000 (21:31 -0800)
The GIF decoder, in the onDecode() function, tries to obtain the
transparency info from the temporary SavedImage object, temp_save,
but the decoder had been changed to save extension block data to
the GifFileType object instead. As a result, find_transpIndex() can't
find the correct transaprency index and returns -1.

This had been reported in Android 4.4. AOSP pulled skia changes
related to giflib 5.x changes after Android 4.3, which is why
the problem is not reproducible in versions before KitKat.

AOSP Issue 62016:
https://code.google.com/p/android/issues/detail?id=62016

BUG=skia:

Review URL: https://codereview.chromium.org/429053004

AUTHORS
src/images/SkImageDecoder_libgif.cpp

diff --git a/AUTHORS b/AUTHORS
index 3317abc..915393b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -34,3 +34,4 @@ Skia Buildbots <skia.buildbots@gmail.com>
 Steve Singer <steve@ssinger.info>
 The Chromium Authors <*@chromium.org>
 Thiago Fransosi Farina <thiago.farina@gmail.com>
+Jose Mayol <jei.mayol@gmail.com>
index c86daf3..b0ed810 100644 (file)
@@ -477,8 +477,8 @@ SkImageDecoder::Result SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap
                 if (AddExtensionBlock(&temp_save, extData[0],
                                       &extData[1]) == GIF_ERROR) {
 #else
-                if (GifAddExtensionBlock(&gif->ExtensionBlockCount,
-                                         &gif->ExtensionBlocks,
+                if (GifAddExtensionBlock(&temp_save.ExtensionBlockCount,
+                                         &temp_save.ExtensionBlocks,
                                          extFunction,
                                          extData[0],
                                          &extData[1]) == GIF_ERROR) {