summaryrefslogtreecommitdiff
path: root/images/SkImageDecoder_libgif.cpp
diff options
context:
space:
mode:
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2010-02-05 15:43:07 +0000
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2010-02-05 15:43:07 +0000
commitaeeaef70462d8142c0808f0168a946dc4d39bc25 (patch)
treefe6fd9869cf9060d16a4d3f809d7057e8f240f23 /images/SkImageDecoder_libgif.cpp
parentab898c759db71175742dfe8a743680f03aa57bb2 (diff)
downloadsrc-aeeaef70462d8142c0808f0168a946dc4d39bc25.tar.gz
check for null cmap in libgif
support bounds-only in libjpeg even if we can't complete start_decompress git-svn-id: http://skia.googlecode.com/svn/trunk/src@486 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'images/SkImageDecoder_libgif.cpp')
-rw-r--r--images/SkImageDecoder_libgif.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/images/SkImageDecoder_libgif.cpp b/images/SkImageDecoder_libgif.cpp
index 86ead1fa..258a8a01 100644
--- a/images/SkImageDecoder_libgif.cpp
+++ b/images/SkImageDecoder_libgif.cpp
@@ -119,8 +119,8 @@ static const ColorMapObject* find_colormap(const GifFileType* gif) {
cmap = gif->SColorMap;
}
// some sanity checks
- if ((unsigned)cmap->ColorCount > 256 ||
- cmap->ColorCount != (1 << cmap->BitsPerPixel)) {
+ if (cmap && ((unsigned)cmap->ColorCount > 256 ||
+ cmap->ColorCount != (1 << cmap->BitsPerPixel))) {
cmap = NULL;
}
return cmap;