Index: src/utils/SkFrontBufferedStream.cpp |
diff --git a/src/utils/SkFrontBufferedStream.cpp b/src/utils/SkFrontBufferedStream.cpp |
index 8cb3931082c75d268e793212a73f688a1dbe227f..80a2bcfce32a2d27d2c7124c6117806b2548a11f 100644 |
--- a/src/utils/SkFrontBufferedStream.cpp |
+++ b/src/utils/SkFrontBufferedStream.cpp |
@@ -175,7 +175,7 @@ size_t FrontBufferedStream::read(void* voidDst, size_t size) { |
// Buffer any more data that should be buffered, and copy it to the |
// destination. |
- if (size > 0 && fBufferedSoFar < fBufferSize) { |
+ if (size > 0 && fBufferedSoFar < fBufferSize && !fStream->isAtEnd()) { |
const size_t buffered = this->bufferAndWriteTo(dst, size); |
// Update the remaining number of bytes needed to read |