diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-03-15 16:59:14 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-03-15 16:59:14 +0000 |
commit | 9db2f426e20d172e3cf35a7167eaaa1f5c8821d4 (patch) | |
tree | ca6d77dc34d13cf5d7f1a4ee93f5686d48804c34 | |
parent | a74aa0ab1277a1664d0940688283f9119ec61947 (diff) | |
parent | 56fadcb037d2a17736f0bc118f7226fc6f002d85 (diff) | |
download | ex-oreo-m2-release.tar.gz |
Snap for 4603989 from 56fadcb037d2a17736f0bc118f7226fc6f002d85 to oc-m2-releaseandroid-8.1.0_r52android-8.1.0_r50android-8.1.0_r47android-8.1.0_r46android-8.1.0_r43android-8.1.0_r41android-8.1.0_r36android-8.1.0_r35android-8.1.0_r33android-8.1.0_r30android-8.1.0_r26android-8.1.0_r25android-8.1.0_r20oreo-m7-releaseoreo-m6-s4-releaseoreo-m6-s3-releaseoreo-m6-s2-releaseoreo-m2-s5-releaseoreo-m2-s4-releaseoreo-m2-s3-releaseoreo-m2-s2-releaseoreo-m2-s1-releaseoreo-m2-release
Change-Id: I8d8d3ca66d4c93462a32e642e5ff895947c09ba7
-rw-r--r-- | framesequence/jni/FrameSequence_gif.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/framesequence/jni/FrameSequence_gif.cpp b/framesequence/jni/FrameSequence_gif.cpp index 3ba09dca..ed478342 100644 --- a/framesequence/jni/FrameSequence_gif.cpp +++ b/framesequence/jni/FrameSequence_gif.cpp @@ -111,12 +111,14 @@ FrameSequence_gif::FrameSequence_gif(Stream* stream) : } #endif - if (mGif->SColorMap) { + const ColorMapObject* cmap = mGif->SColorMap; + if (cmap) { // calculate bg color GraphicsControlBlock gcb; DGifSavedExtensionToGCB(mGif, 0, &gcb); - if (gcb.TransparentColor == NO_TRANSPARENT_COLOR) { - mBgColor = gifColorToColor8888(mGif->SColorMap->Colors[mGif->SBackGroundColor]); + if (gcb.TransparentColor == NO_TRANSPARENT_COLOR + && mGif->SBackGroundColor < cmap->ColorCount) { + mBgColor = gifColorToColor8888(cmap->Colors[mGif->SBackGroundColor]); } } } @@ -358,4 +360,3 @@ static RegistryEntry gEntry = { acceptsBuffers, }; static Registry gRegister(gEntry); - |