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

Unified Diff: src/core/SkBuffer.cpp

Issue 61913002: Adding error checks to SkRBuffer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added doc Created 7 years, 1 month 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 | « src/core/SkBuffer.h ('k') | src/core/SkFlattenableBuffers.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 32a8011ac787a34f26ab1f57869aba1b7b5e180e..590b05b859824ff2ba0d35952d23396a87c95c83 100644
--- a/src/core/SkBuffer.cpp
+++ b/src/core/SkBuffer.cpp
@@ -34,11 +34,12 @@ size_t SkRBuffer::skipToAlign4()
return n;
}
-void SkRBufferWithSizeCheck::read(void* buffer, size_t size) {
+bool SkRBufferWithSizeCheck::read(void* buffer, size_t size) {
fError = fError || (fPos + size > fStop);
if (!fError && (size > 0)) {
readNoSizeCheck(buffer, size);
}
+ return !fError;
}
void* SkWBuffer::skip(size_t size)
« no previous file with comments | « src/core/SkBuffer.h ('k') | src/core/SkFlattenableBuffers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698