summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--framesequence/Android.mk2
-rw-r--r--framesequence/jni/FrameSequence_gif.cpp9
2 files changed, 6 insertions, 5 deletions
diff --git a/framesequence/Android.mk b/framesequence/Android.mk
index 1b3cf2d8..dbe47ea8 100644
--- a/framesequence/Android.mk
+++ b/framesequence/Android.mk
@@ -25,4 +25,4 @@ LOCAL_PROGUARD_FLAG_FILES := proguard.flags
include $(BUILD_STATIC_JAVA_LIBRARY)
-include $(call all-makefiles-under, $(LOCAL_PATH))
+include $(call first-makefiles-under, $(LOCAL_PATH))
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);
-