aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaesung Chung <jaesung@google.com>2016-04-20 14:22:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-04-20 14:22:08 +0000
commitf74462ad127da297d3f216d552e49c9e6917b616 (patch)
tree1099334fd3822a562d37d4a8155736b9ed386566
parent918d933fe92a1ef4b7cfbda8267d87e4b6c9973f (diff)
parenta0e519dd4d837a9f8ebab058de90c57387902738 (diff)
downloadskia-f74462ad127da297d3f216d552e49c9e6917b616.tar.gz
Merge "skia: fix a regression in decoding DNG" into nyc-dev
-rw-r--r--DEPS2
-rw-r--r--src/codec/SkRawCodec.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/DEPS b/DEPS
index a723d8d7ce..bf5c591910 100644
--- a/DEPS
+++ b/DEPS
@@ -22,7 +22,7 @@ deps = {
"third_party/externals/giflib" : "https://android.googlesource.com/platform/external/giflib.git@ab10e256df4f684260ca239905b1cec727181f6c",
"third_party/externals/dng_sdk" : "https://android.googlesource.com/platform/external/dng_sdk.git@6579353b8ee5d8aa1f1a96ae22798de9b41e19b8",
- "third_party/externals/piex" : "https://android.googlesource.com/platform/external/piex.git@883a1e5419990f51b8e928969e9c5a09869bce0e",
+ "third_party/externals/piex" : "https://android.googlesource.com/platform/external/piex.git@be908191d0a6883a95333bdc0bca749c9b830969",
"third_party/externals/libjpeg-turbo" : "https://skia.googlesource.com/third_party/libjpeg-turbo.git@7bf1a3c9b06bede89cec37cec0b5085c0d6d6c13",
# libjpeg-turbo depends on yasm to compile .asm files
diff --git a/src/codec/SkRawCodec.cpp b/src/codec/SkRawCodec.cpp
index 208bd8952d..ab2c55d9aa 100644
--- a/src/codec/SkRawCodec.cpp
+++ b/src/codec/SkRawCodec.cpp
@@ -637,7 +637,11 @@ SkCodec* SkRawCodec::NewFromStream(SkStream* stream) {
if (::piex::IsRaw(&piexStream)) {
::piex::Error error = ::piex::GetPreviewImageData(&piexStream, &imageData);
- if (error == ::piex::Error::kOk && imageData.preview.length > 0) {
+ // Theoretically PIEX can return JPEG compressed image or uncompressed RGB image. We only
+ // handle the JPEG compressed preview image here.
+ if (error == ::piex::Error::kOk && imageData.preview.length > 0 &&
+ imageData.preview.format == ::piex::Image::kJpegCompressed)
+ {
// transferBuffer() is destructive to the rawStream. Abandon the rawStream after this
// function call.
// FIXME: one may avoid the copy of memoryStream and use the buffered rawStream.