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

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

Issue 100803004: Changed maxInputCount for exact inputCount (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added a few spaces Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/animator/SkScript.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | 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 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 7
8 #include "SkImageFilter.h" 8 #include "SkImageFilter.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 SkSafeRef(fInputs[1]); 46 SkSafeRef(fInputs[1]);
47 } 47 }
48 48
49 SkImageFilter::~SkImageFilter() { 49 SkImageFilter::~SkImageFilter() {
50 for (int i = 0; i < fInputCount; i++) { 50 for (int i = 0; i < fInputCount; i++) {
51 SkSafeUnref(fInputs[i]); 51 SkSafeUnref(fInputs[i]);
52 } 52 }
53 delete[] fInputs; 53 delete[] fInputs;
54 } 54 }
55 55
56 SkImageFilter::SkImageFilter(int maxInputCount, SkFlattenableReadBuffer& buffer) { 56 SkImageFilter::SkImageFilter(int inputCount, SkFlattenableReadBuffer& buffer) {
57 fInputCount = buffer.readInt(); 57 fInputCount = buffer.readInt();
58 if (buffer.validate((fInputCount >= 0) && (fInputCount <= maxInputCount))) { 58 if (buffer.validate(((inputCount < 0) && (fInputCount >= 0)) || (fInputCount == inputCount))) {
Stephen White 2013/12/03 19:10:23 I think this will pass validation if a deserialize
sugoi 2013/12/03 19:21:49 Done.
59 fInputs = new SkImageFilter*[fInputCount]; 59 fInputs = new SkImageFilter*[fInputCount];
60 for (int i = 0; i < fInputCount; i++) { 60 for (int i = 0; i < fInputCount; i++) {
61 if (buffer.readBool()) { 61 if (buffer.readBool()) {
62 fInputs[i] = buffer.readImageFilter(); 62 fInputs[i] = buffer.readImageFilter();
63 } else { 63 } else {
64 fInputs[i] = NULL; 64 fInputs[i] = NULL;
65 } 65 }
66 } 66 }
67 SkRect rect; 67 SkRect rect;
68 buffer.readRect(&rect); 68 buffer.readRect(&rect);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return true; 187 return true;
188 } 188 }
189 189
190 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&, cons t SkIRect&) const { 190 bool SkImageFilter::asNewEffect(GrEffectRef**, GrTexture*, const SkMatrix&, cons t SkIRect&) const {
191 return false; 191 return false;
192 } 192 }
193 193
194 bool SkImageFilter::asColorFilter(SkColorFilter**) const { 194 bool SkImageFilter::asColorFilter(SkColorFilter**) const {
195 return false; 195 return false;
196 } 196 }
OLDNEW
« no previous file with comments | « src/animator/SkScript.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698