summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2017-11-08 02:35:42 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-11-08 02:35:42 +0000
commit220d1194887722c33cadcdd29ba81fc8929c95f8 (patch)
tree0e770228f769d1586bf5a6956d0420f85339533b
parentee4e5f8511e7d383304cdd6024b640a21fb1f39f (diff)
parent7235e1721d77ed4453972060ba7cf03336facde3 (diff)
downloadex-220d1194887722c33cadcdd29ba81fc8929c95f8.tar.gz
Skip composition of frames lacking a color map am: 0dc887f70e am: d615be0039 am: 5c24be498e am: 5943b3b00d am: 23f4980f7e am: c3621ebb09 am: 73bf156019 am: 65fa609014 am: 6e67fc565b am: cb659dbb96 am: 90cbf18e70 am: c5be0c584f am: 97183a1c99
am: 7235e1721d Change-Id: I8d2c15c454a3751e7354be75782fb9e5109bb612
-rw-r--r--framesequence/jni/FrameSequence_gif.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/framesequence/jni/FrameSequence_gif.cpp b/framesequence/jni/FrameSequence_gif.cpp
index 5118319a..3ba09dca 100644
--- a/framesequence/jni/FrameSequence_gif.cpp
+++ b/framesequence/jni/FrameSequence_gif.cpp
@@ -307,19 +307,18 @@ long FrameSequenceState_gif::drawFrame(int frameNr,
cmap = frame.ImageDesc.ColorMap;
}
- if (cmap == NULL || cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
- ALOGW("Warning: potentially corrupt color map");
- }
-
- const unsigned char* src = (unsigned char*)frame.RasterBits;
- Color8888* dst = outputPtr + frame.ImageDesc.Left +
- frame.ImageDesc.Top * outputPixelStride;
- GifWord copyWidth, copyHeight;
- getCopySize(frame.ImageDesc, width, height, copyWidth, copyHeight);
- for (; copyHeight > 0; copyHeight--) {
- copyLine(dst, src, cmap, gcb.TransparentColor, copyWidth);
- src += frame.ImageDesc.Width;
- dst += outputPixelStride;
+ // If a cmap is missing, the frame can't be decoded, so we skip it.
+ if (cmap) {
+ const unsigned char* src = (unsigned char*)frame.RasterBits;
+ Color8888* dst = outputPtr + frame.ImageDesc.Left +
+ frame.ImageDesc.Top * outputPixelStride;
+ GifWord copyWidth, copyHeight;
+ getCopySize(frame.ImageDesc, width, height, copyWidth, copyHeight);
+ for (; copyHeight > 0; copyHeight--) {
+ copyLine(dst, src, cmap, gcb.TransparentColor, copyWidth);
+ src += frame.ImageDesc.Width;
+ dst += outputPixelStride;
+ }
}
}
}