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

Unified Diff: src/core/SkBuffer.cpp

Issue 1589533002: Fix fuzzer-found deserialization bugs (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fix build error by using explicit cast Created 4 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 | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698