From 14494262d39964ccd7f0fbac43f45ac2ea1eb224 Mon Sep 17 00:00:00 2001 From: Leon Scroggins III Date: Fri, 17 Oct 2014 15:23:37 -0400 Subject: Decoder only returns true on complete success. Recently we added a way for SkImageDecoder::decode to distinguish between successfully decoding the entire image and only partially decoding the image (see https://codereview.chromium.org/647023006). Only consider a call to decode() a success if the image was completely decoded. This matches pre-L behavior, and lets the caller know that they need to try to decode again. Requires a change to external/skia (I33e6940e247b74b20361ae041f8d36eb600df49f) BUG:17419670 Change-Id: I17ed7288b2359fafaec9551adb16d1d037800eb7 --- core/jni/android/graphics/BitmapFactory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/jni/android') diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp index e0abc24..a578b5d 100644 --- a/core/jni/android/graphics/BitmapFactory.cpp +++ b/core/jni/android/graphics/BitmapFactory.cpp @@ -315,7 +315,8 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding } SkBitmap decodingBitmap; - if (!decoder->decode(stream, &decodingBitmap, prefColorType, decodeMode)) { + if (decoder->decode(stream, &decodingBitmap, prefColorType, decodeMode) + != SkImageDecoder::kSuccess) { return nullObjectReturn("decoder->decode returned false"); } -- cgit v1.1