Index: src/core/SkStream.cpp |
diff --git a/src/core/SkStream.cpp b/src/core/SkStream.cpp |
index 80628d452c79773515c2323f135f6e13aea98fb4..9529308e8689ff135aa77e24dddb7639ec97a812 100644 |
--- a/src/core/SkStream.cpp |
+++ b/src/core/SkStream.cpp |
@@ -890,9 +890,12 @@ |
} |
SkDynamicMemoryWStream tempStream; |
- if (!SkStreamCopy(&tempStream, stream)) { |
- return nullptr; |
- } |
+ const size_t bufferSize = 4096; |
+ char buffer[bufferSize]; |
+ do { |
+ size_t bytesRead = stream->read(buffer, bufferSize); |
+ tempStream.write(buffer, bytesRead); |
+ } while (!stream->isAtEnd()); |
return tempStream.copyToData(); |
} |