Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: src/images/SkImageDecoder_libgif.cpp

Issue 658343003: Fixes for partial images. (Closed) Base URL: https://skia.googlesource.com/skia.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/config/SkUserConfig.h ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libgif.cpp
diff --git a/src/images/SkImageDecoder_libgif.cpp b/src/images/SkImageDecoder_libgif.cpp
index 81071c95158be16957e20d3fdfb0ad3554ade7ce..e7122d76676ee3d7a5a6411e5535fedfbff28745 100644
--- a/src/images/SkImageDecoder_libgif.cpp
+++ b/src/images/SkImageDecoder_libgif.cpp
@@ -417,6 +417,7 @@ bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
GifInterlaceIter iter(innerHeight);
for (int y = 0; y < innerHeight; y++) {
if (DGifGetLine(gif, scanline, innerWidth) == GIF_ERROR) {
+#ifdef SK_DECODE_PARTIAL_IMAGES
gif_warning(*bm, "interlace DGifGetLine");
memset(scanline, fillIndex, innerWidth);
for (; y < innerHeight; y++) {
@@ -424,6 +425,9 @@ bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
iter.next();
}
return true;
+#else
+ return error_return(*bm, "interlace DGifGetLine");
+#endif
}
sampler.sampleInterlaced(scanline, iter.currY());
iter.next();
@@ -434,12 +438,16 @@ bool SkGIFImageDecoder::onDecode(SkStream* sk_stream, SkBitmap* bm, Mode mode) {
skip_src_rows(gif, scanline, innerWidth, sampler.srcY0());
for (int y = 0; y < outHeight; y++) {
if (DGifGetLine(gif, scanline, innerWidth) == GIF_ERROR) {
+#ifdef SK_DECODE_PARTIAL_IMAGES
gif_warning(*bm, "DGifGetLine");
memset(scanline, fillIndex, innerWidth);
for (; y < outHeight; y++) {
sampler.next(scanline);
}
return true;
+#else
+ return error_return(*bm, "DGifGetLine");
+#endif
}
// scanline now contains the raw data. Sample it.
sampler.next(scanline);
« no previous file with comments | « include/config/SkUserConfig.h ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698