| Index: src/codec/SkWebpCodec.cpp
|
| diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
|
| index ccffda9276857e9549cd9fb1263577b3a9c59d68..a0fab0a153d67f0d32375ac7405d06314a7bb317 100644
|
| --- a/src/codec/SkWebpCodec.cpp
|
| +++ b/src/codec/SkWebpCodec.cpp
|
| @@ -158,7 +158,8 @@ bool SkWebpCodec::onGetValidSubset(SkIRect* desiredSubset) const {
|
| }
|
|
|
| SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst, size_t rowBytes,
|
| - const Options& options, SkPMColor*, int*) {
|
| + const Options& options, SkPMColor*, int*,
|
| + int* rowsDecoded) {
|
| if (!webp_conversion_possible(dstInfo, this->getInfo())) {
|
| return kInvalidConversion;
|
| }
|
| @@ -234,10 +235,8 @@ SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst,
|
| while (true) {
|
| const size_t bytesRead = stream()->read(buffer, BUFFER_SIZE);
|
| if (0 == bytesRead) {
|
| - // FIXME: Maybe this is an incomplete image? How to decide? Based
|
| - // on the number of rows decoded? We can know the number of rows
|
| - // decoded using WebPIDecGetRGB.
|
| - return kInvalidInput;
|
| + WebPIDecGetRGB(idec, rowsDecoded, NULL, NULL, NULL);
|
| + return kIncompleteInput;
|
| }
|
|
|
| switch (WebPIAppend(idec, buffer, bytesRead)) {
|
|
|