summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2016-10-18 17:17:41 (GMT)
committerJessica Wagantall <jwagantall@cyngn.com>2016-12-12 19:56:58 (GMT)
commit4bfd4bae257bef1693e3585b5e0f3f9d397372aa (patch)
treed3e738bbbd0354b0353e791f778bdae0b6fe490f
parent8d069cf9807027f7b3148589292f8f0544179ebf (diff)
downloadandroid_frameworks_ex-4bfd4bae257bef1693e3585b5e0f3f9d397372aa.zip
android_frameworks_ex-4bfd4bae257bef1693e3585b5e0f3f9d397372aa.tar.gz
android_frameworks_ex-4bfd4bae257bef1693e3585b5e0f3f9d397372aa.tar.bz2
Handle color bounds correctly in GIF decode.
CYNGNOS-3312 Bug: 31631842 Change-Id: Ia4d25d9cd440286366f82433d3ff227384c0572f (cherry picked from commit 0ada9456d0270cb0e357a43d9187a6418d770760) (cherry picked from commit ade3088d82be5ddf9cbe434c2810ed12ef88b723)
-rw-r--r--framesequence/jni/FrameSequence_gif.cpp2
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]);
}
}