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

Side by Side Diff: src/effects/SkDashPathEffect.cpp

Issue 275053004: Add check for bad dash interval in dash effect picture read (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove printf Created 6 years, 7 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkDashPathEffect.h" 10 #include "SkDashPathEffect.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 size_t allocSize = sizeof(SkScalar) * fCount; 558 size_t allocSize = sizeof(SkScalar) * fCount;
559 if (buffer.validateAvailable(allocSize)) { 559 if (buffer.validateAvailable(allocSize)) {
560 fIntervals = (SkScalar*)sk_malloc_throw(allocSize); 560 fIntervals = (SkScalar*)sk_malloc_throw(allocSize);
561 buffer.readScalarArray(fIntervals, fCount); 561 buffer.readScalarArray(fIntervals, fCount);
562 } else { 562 } else {
563 fIntervals = NULL; 563 fIntervals = NULL;
564 } 564 }
565 565
566 if (useOldPic) { 566 if (useOldPic) {
567 fPhase = 0; 567 fPhase = 0;
568 for (int i = 0; i < fInitialDashIndex; ++i) { 568 if (fInitialDashLength != -1) { // Signal for bad dash interval
569 fPhase += fIntervals[i]; 569 for (int i = 0; i < fInitialDashIndex; ++i) {
570 fPhase += fIntervals[i];
571 }
572 fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength;
570 } 573 }
571 fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength;
572 } else { 574 } else {
573 this->setInternalMembers(fPhase); 575 this->setInternalMembers(fPhase);
574 } 576 }
575 } 577 }
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