diff options
author | Chris Craik <ccraik@google.com> | 2016-10-18 10:17:41 -0700 |
---|---|---|
committer | Jessica Wagantall <jwagantall@cyngn.com> | 2016-12-09 10:56:02 -0800 |
commit | ade3088d82be5ddf9cbe434c2810ed12ef88b723 (patch) | |
tree | d3e738bbbd0354b0353e791f778bdae0b6fe490f | |
parent | 8d069cf9807027f7b3148589292f8f0544179ebf (diff) | |
download | android_frameworks_ex-stable/cm-13.0-ZNH0E.tar.gz android_frameworks_ex-stable/cm-13.0-ZNH0E.tar.bz2 android_frameworks_ex-stable/cm-13.0-ZNH0E.zip |
Handle color bounds correctly in GIF decode.stable/cm-13.0-ZNH0E
CYNGNOS-3312
Bug: 31631842
Change-Id: Ia4d25d9cd440286366f82433d3ff227384c0572f
(cherry picked from commit 0ada9456d0270cb0e357a43d9187a6418d770760)
-rw-r--r-- | framesequence/jni/FrameSequence_gif.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/framesequence/jni/FrameSequence_gif.cpp b/framesequence/jni/FrameSequence_gif.cpp index 2188c53..e658425 100644 --- a/framesequence/jni/FrameSequence_gif.cpp +++ b/framesequence/jni/FrameSequence_gif.cpp @@ -157,7 +157,7 @@ static bool checkIfCover(const GifImageDesc& target, const GifImageDesc& covered static void copyLine(Color8888* dst, const unsigned char* src, const ColorMapObject* cmap, int transparent, int width) { for (; width > 0; width--, src++, dst++) { - if (*src != transparent) { + if (*src != transparent && *src < cmap->ColorCount) { *dst = gifColorToColor8888(cmap->Colors[*src]); } } |