Index: src/core/SkBuffer.cpp |
diff --git a/src/core/SkBuffer.cpp b/src/core/SkBuffer.cpp |
index 86c3bed3f14ad2272b0aa851308757f557c86b85..df8dc6959469876af8a8a77ef36f688a456764c1 100644 |
--- a/src/core/SkBuffer.cpp |
+++ b/src/core/SkBuffer.cpp |
@@ -35,7 +35,7 @@ size_t SkRBuffer::skipToAlign4() |
} |
bool SkRBufferWithSizeCheck::read(void* buffer, size_t size) { |
- fError = fError || (fPos + size > fStop); |
+ fError = fError || (size > static_cast<size_t>(fStop - fPos)); |
if (!fError && (size > 0)) { |
readNoSizeCheck(buffer, size); |
} |