Index: third_party/libwebp/dec/idec.c |
diff --git a/third_party/libwebp/dec/idec.c b/third_party/libwebp/dec/idec.c |
index 7bab1eab795f4743510514fb2de37d860906c139..5d8bb0c2901a7d5d9e93d8e6e15f17ead5d32633 100644 |
--- a/third_party/libwebp/dec/idec.c |
+++ b/third_party/libwebp/dec/idec.c |
@@ -529,6 +529,12 @@ static VP8StatusCode DecodeVP8LData(WebPIDecoder* const idec) { |
} |
if (!VP8LDecodeImage(dec)) { |
+ // The decoding is called after all the data-bytes are aggregated. Change |
+ // the error to VP8_BITSTREAM_ERROR in case lossless decoder fails to decode |
+ // all the pixels (VP8_STATUS_SUSPENDED). |
+ if (dec->status_ == VP8_STATUS_SUSPENDED) { |
+ dec->status_ = VP8_STATUS_BITSTREAM_ERROR; |
+ } |
return ErrorStatusLossless(idec, dec->status_); |
} |