Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(849)

Side by Side Diff: src/core/SkPictureFlat.h

Issue 6250054: Fixing a reader size overflow whenunflattening large bitmaps (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 12 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
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 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #ifndef SkPictureFlat_DEFINED 8 #ifndef SkPictureFlat_DEFINED
9 #define SkPictureFlat_DEFINED 9 #define SkPictureFlat_DEFINED
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 int fIndex; 145 int fIndex;
146 int32_t fAllocSize; 146 int32_t fAllocSize;
147 }; 147 };
148 148
149 class SkFlatBitmap : public SkFlatData { 149 class SkFlatBitmap : public SkFlatData {
150 public: 150 public:
151 static SkFlatBitmap* Flatten(SkChunkAlloc*, const SkBitmap&, int index, 151 static SkFlatBitmap* Flatten(SkChunkAlloc*, const SkBitmap&, int index,
152 SkRefCntSet*); 152 SkRefCntSet*);
153 153
154 void unflatten(SkBitmap* bitmap, SkRefCntPlayback* rcp) const { 154 void unflatten(SkBitmap* bitmap, SkRefCntPlayback* rcp) const {
155 SkOrderedReadBuffer buffer(fBitmapData, 1024*1024); 155 SkOrderedReadBuffer buffer(fBitmapData, fAllocSize);
156 if (rcp) { 156 if (rcp) {
157 rcp->setupBuffer(buffer); 157 rcp->setupBuffer(buffer);
158 } 158 }
159 bitmap->unflatten(buffer); 159 bitmap->unflatten(buffer);
160 } 160 }
161 161
162 #ifdef SK_DEBUG_VALIDATE 162 #ifdef SK_DEBUG_VALIDATE
163 void validate() const { 163 void validate() const {
164 // to be written 164 // to be written
165 } 165 }
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // to be written 229 // to be written
230 } 230 }
231 #endif 231 #endif
232 232
233 private: 233 private:
234 char fRegionData[1]; 234 char fRegionData[1];
235 typedef SkFlatData INHERITED; 235 typedef SkFlatData INHERITED;
236 }; 236 };
237 237
238 #endif 238 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b