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

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

Issue 1893423002: Fix ImageFilter fuzzer issue (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove setOffset Created 4 years, 8 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 | « src/core/SkValidatingReadBuffer.h ('k') | 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 2013 Google Inc. 2 * Copyright 2013 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 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkErrorInternals.h" 9 #include "SkErrorInternals.h"
10 #include "SkValidatingReadBuffer.h" 10 #include "SkValidatingReadBuffer.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 } 138 }
139 } 139 }
140 140
141 void SkValidatingReadBuffer::readRect(SkRect* rect) { 141 void SkValidatingReadBuffer::readRect(SkRect* rect) {
142 const void* ptr = this->skip(sizeof(SkRect)); 142 const void* ptr = this->skip(sizeof(SkRect));
143 if (!fError) { 143 if (!fError) {
144 memcpy(rect, ptr, sizeof(SkRect)); 144 memcpy(rect, ptr, sizeof(SkRect));
145 } 145 }
146 } 146 }
147 147
148 void SkValidatingReadBuffer::readRRect(SkRRect* rrect) {
149 const void* ptr = this->skip(sizeof(SkRRect));
150 if (!fError) {
151 memcpy(rrect, ptr, sizeof(SkRRect));
152 }
153 }
154
148 void SkValidatingReadBuffer::readRegion(SkRegion* region) { 155 void SkValidatingReadBuffer::readRegion(SkRegion* region) {
149 size_t size = 0; 156 size_t size = 0;
150 if (!fError) { 157 if (!fError) {
151 size = region->readFromMemory(fReader.peek(), fReader.available()); 158 size = region->readFromMemory(fReader.peek(), fReader.available());
152 this->validate((SkAlign4(size) == size) && (0 != size)); 159 this->validate((SkAlign4(size) == size) && (0 != size));
153 } 160 }
154 if (!fError) { 161 if (!fError) {
155 (void)this->skip(size); 162 (void)this->skip(size);
156 } 163 }
157 } 164 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 267
261 void SkValidatingReadBuffer::skipFlattenable() { 268 void SkValidatingReadBuffer::skipFlattenable() {
262 SkString name; 269 SkString name;
263 this->readString(&name); 270 this->readString(&name);
264 if (fError) { 271 if (fError) {
265 return; 272 return;
266 } 273 }
267 uint32_t sizeRecorded = this->readUInt(); 274 uint32_t sizeRecorded = this->readUInt();
268 this->skip(sizeRecorded); 275 this->skip(sizeRecorded);
269 } 276 }
OLDNEW
« no previous file with comments | « src/core/SkValidatingReadBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698