Chromium Code Reviews| Index: src/core/SkPictureData.cpp |
| diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp |
| index fc4fdb8230d14655555b8ab35c4d4cf5beb8a2de..5cb8a2d6e05ffd26ebae682492d0074e954ad6da 100644 |
| --- a/src/core/SkPictureData.cpp |
| +++ b/src/core/SkPictureData.cpp |
| @@ -373,26 +373,14 @@ bool SkPictureData::parseStreamTag(SkStream* stream, |
| } |
| } break; |
| case SK_PICT_PICTURE_TAG: { |
| - fPictureCount = size; |
| - fPictureRefs = SkNEW_ARRAY(const SkPicture*, fPictureCount); |
| - bool success = true; |
| - int i = 0; |
| - for ( ; i < fPictureCount; i++) { |
| + fPictureCount = 0; |
| + fPictureRefs = SkNEW_ARRAY(const SkPicture*, size); |
| + for (uint32_t i = 0; i < size; i++) { |
| fPictureRefs[i] = SkPicture::CreateFromStream(stream, proc); |
| - if (NULL == fPictureRefs[i]) { |
| - success = false; |
| - break; |
| - } |
| - } |
| - if (!success) { |
| - // Delete all of the pictures that were already created (up to but excluding i): |
| - for (int j = 0; j < i; j++) { |
| - fPictureRefs[j]->unref(); |
| - } |
| - // Delete the array |
| - SkDELETE_ARRAY(fPictureRefs); |
| - fPictureCount = 0; |
| - return false; |
| + if (!fPictureRefs[i]) { |
|
mtklein
2015/07/29 21:22:43
Is it just codereview or is there an extra space o
f(malita)
2015/07/29 21:26:07
Extra space from me being too lazy to type :P
|
| + return false; |
| + } |
| + fPictureCount++; |
| } |
| } break; |
| case SK_PICT_BUFFER_SIZE_TAG: { |