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

Unified Diff: src/core/SkPicture.cpp

Issue 14158015: Allow supporting older PICTURE_VERSIONs. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 8 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/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index 1ff58656512681ed5ac056d1399f9558c33f0c91..39d0653a1b5ac3528e10d14fafda891a047e4299 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -6,7 +6,7 @@
* found in the LICENSE file.
*/
-
+#include "SkErrorInternals.h"
#include "SkPictureFlat.h"
#include "SkPicturePlayback.h"
#include "SkPictureRecord.h"
@@ -283,9 +283,13 @@ void SkPicture::initFromStream(SkStream* stream, bool* success, InstallPixelRefP
SkPictInfo info;
if (!stream->read(&info, sizeof(info))) {
+ SkErrorInternals::SetError(kParseError_SkError, "Failed to parse skp info.");
return;
}
- if (PICTURE_VERSION != info.fVersion) {
+
+ if (info.fVersion < 10 || info.fVersion > PICTURE_VERSION) {
scroggo 2013/04/29 19:00:40 This needs to be duplicated in QT/SkDebuggerGUI.cp
+ SkErrorInternals::SetError(kParseError_SkError, "skp version %d not supported.",
+ info.fVersion);
return;
}

Powered by Google App Engine
This is Rietveld 408576698