diff options
author | scroggo <scroggo@google.com> | 2015-01-29 11:58:45 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-29 11:58:45 -0800 |
commit | 65df6edf63c6b97ea81fb647c4ebd85729a750a2 (patch) | |
tree | db0cdd45dc6b75d6e90afec2e868f70cdf803712 /src/images | |
parent | 19d8f9f17373bcf7d352b77e72a6a46568ee8a8b (diff) |
SkStream::read() only returns 0 at end.
All implementations behave this way, so respect it.
BUG=skia:2936
Review URL: https://codereview.chromium.org/888703002
Diffstat (limited to 'src/images')
-rw-r--r-- | src/images/SkImageDecoder_libwebp.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp index 5ac647a588..d2061dbd10 100644 --- a/src/images/SkImageDecoder_libwebp.cpp +++ b/src/images/SkImageDecoder_libwebp.cpp @@ -59,10 +59,8 @@ static bool webp_parse_header(SkStream* stream, int* width, int* height, int* al unsigned char* dst = buffer + totalBytesRead; const size_t bytesRead = stream->read(dst, bytesToRead); if (0 == bytesRead) { - // Could not read any bytes. Check to see if we are at the end (exit - // condition), and continue reading if not. Important for streams - // that do not have all the data ready. - continue; + SkASSERT(stream->isAtEnd()); + break; } bytesToRead -= bytesRead; totalBytesRead += bytesRead; |