forked from Grouper-AOSP/platform_manifest
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathframeworks_ex.patch
27 lines (26 loc) · 1023 Bytes
/
frameworks_ex.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/framesequence/jni/FrameSequence_gif.cpp b/framesequence/jni/FrameSequence_gif.cpp
index 5118319..f6f46da 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]);
}
}
}
@@ -359,4 +361,3 @@ static RegistryEntry gEntry = {
acceptsBuffers,
};
static Registry gRegister(gEntry);
-