Chromium Code Reviews| 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; |
| } |