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

Side by Side Diff: src/core/SkPictureData.cpp

Issue 1617033002: fix skp fuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include <new> 7 #include <new>
8 #include "SkImageGenerator.h" 8 #include "SkImageGenerator.h"
9 #include "SkPictureData.h" 9 #include "SkPictureData.h"
10 #include "SkPictureRecord.h" 10 #include "SkPictureRecord.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 SkAutoMalloc storage(size); 406 SkAutoMalloc storage(size);
407 if (stream->read(storage.get(), size) != size) { 407 if (stream->read(storage.get(), size) != size) {
408 return false; 408 return false;
409 } 409 }
410 410
411 /* Should we use SkValidatingReadBuffer instead? */ 411 /* Should we use SkValidatingReadBuffer instead? */
412 SkReadBuffer buffer(storage.get(), size); 412 SkReadBuffer buffer(storage.get(), size);
413 buffer.setFlags(pictInfoFlagsToReadBufferFlags(fInfo.fFlags)); 413 buffer.setFlags(pictInfoFlagsToReadBufferFlags(fInfo.fFlags));
414 buffer.setVersion(fInfo.fVersion); 414 buffer.setVersion(fInfo.fVersion);
415 415
416 if (!fFactoryPlayback) {
417 return false;
418 }
416 fFactoryPlayback->setupBuffer(buffer); 419 fFactoryPlayback->setupBuffer(buffer);
417 buffer.setBitmapDecoder(proc); 420 buffer.setBitmapDecoder(proc);
418 421
419 if (fTFPlayback.count() > 0) { 422 if (fTFPlayback.count() > 0) {
420 // .skp files <= v43 have typefaces serialized with each sub pic ture. 423 // .skp files <= v43 have typefaces serialized with each sub pic ture.
421 fTFPlayback.setupBuffer(buffer); 424 fTFPlayback.setupBuffer(buffer);
422 } else { 425 } else {
423 // Newer .skp files serialize all typefaces with the top picture . 426 // Newer .skp files serialize all typefaces with the top picture .
424 topLevelTFPlayback->setupBuffer(buffer); 427 topLevelTFPlayback->setupBuffer(buffer);
425 } 428 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 628 }
626 } 629 }
627 630
628 bool SkPictureData::suitableForLayerOptimization() const { 631 bool SkPictureData::suitableForLayerOptimization() const {
629 return fContentInfo.numLayers() > 0; 632 return fContentInfo.numLayers() > 0;
630 } 633 }
631 #endif 634 #endif
632 /////////////////////////////////////////////////////////////////////////////// 635 ///////////////////////////////////////////////////////////////////////////////
633 636
634 637
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698