Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: src/images/SkImageDecoder_libwebp.cpp

Issue 888703002: SkStream::read() only returns 0 at end. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libwebp.cpp
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp
index 5ac647a588322f8fd7d4fd64cf0d2780f1c91556..d2061dbd10deced75e20d3edc75c1b51cab63ef0 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698