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

Unified Diff: src/core/SkOrderedReadBuffer.cpp

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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
Index: src/core/SkOrderedReadBuffer.cpp
diff --git a/src/core/SkOrderedReadBuffer.cpp b/src/core/SkOrderedReadBuffer.cpp
index 9d991949084e5b9586d57baeaadf72363eb3e3ef..bab1626c491b31e77ad7098070f0d0861e3a6989 100644
--- a/src/core/SkOrderedReadBuffer.cpp
+++ b/src/core/SkOrderedReadBuffer.cpp
@@ -300,6 +300,11 @@ SkFlattenable* SkOrderedReadBuffer::readFlattenable() {
if (factory) {
uint32_t offset = fReader.offset();
obj = (*factory)(*this);
+ if (fError != kNoError_SkError) {
+ delete obj;
+ obj = NULL;
+ fError = kNoError_SkError;
reed1 2013/08/21 15:49:24 Hmmm, maybe this is correct (to reset fError to no
sugoi1 2013/08/21 16:52:36 It's only reset here so that the next read operati
scroggo 2013/08/21 23:56:00 This seems to be basically the same, since SkOrder
+ }
// check that we read the amount we expected
uint32_t sizeRead = fReader.offset() - offset;
if (sizeRecorded != sizeRead) {

Powered by Google App Engine
This is Rietveld 408576698