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

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

Issue 61913002: Adding error checks to SkRBuffer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Added doc Created 7 years, 1 month 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/core/SkRegion.cpp ('k') | src/core/SkValidatingReadBuffer.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 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 #ifndef SkValidatingReadBuffer_DEFINED 8 #ifndef SkValidatingReadBuffer_DEFINED
9 #define SkValidatingReadBuffer_DEFINED 9 #define SkValidatingReadBuffer_DEFINED
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE; 53 virtual bool readPointArray(SkPoint* points, size_t size) SK_OVERRIDE;
54 virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE; 54 virtual bool readScalarArray(SkScalar* values, size_t size) SK_OVERRIDE;
55 55
56 // helpers to get info about arrays and binary data 56 // helpers to get info about arrays and binary data
57 virtual uint32_t getArrayCount() SK_OVERRIDE; 57 virtual uint32_t getArrayCount() SK_OVERRIDE;
58 58
59 virtual void readBitmap(SkBitmap* bitmap) SK_OVERRIDE; 59 virtual void readBitmap(SkBitmap* bitmap) SK_OVERRIDE;
60 // TODO: Implement this (securely) when needed 60 // TODO: Implement this (securely) when needed
61 virtual SkTypeface* readTypeface() SK_OVERRIDE; 61 virtual SkTypeface* readTypeface() SK_OVERRIDE;
62 62
63 virtual void validate(bool isValid) SK_OVERRIDE; 63 virtual bool validate(bool isValid) SK_OVERRIDE;
64 64
65 private: 65 private:
66 bool readArray(void* value, size_t size, size_t elementSize); 66 bool readArray(void* value, size_t size, size_t elementSize);
67 67
68 void setMemory(const void* data, size_t size); 68 void setMemory(const void* data, size_t size);
69 69
70 static bool IsPtrAlign4(const void* ptr) { 70 static bool IsPtrAlign4(const void* ptr) {
71 return SkIsAlign4((uintptr_t)ptr); 71 return SkIsAlign4((uintptr_t)ptr);
72 } 72 }
73 73
74 SkReader32 fReader; 74 SkReader32 fReader;
75 bool fError; 75 bool fError;
76 76
77 typedef SkFlattenableReadBuffer INHERITED; 77 typedef SkFlattenableReadBuffer INHERITED;
78 }; 78 };
79 79
80 #endif // SkValidatingReadBuffer_DEFINED 80 #endif // SkValidatingReadBuffer_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkRegion.cpp ('k') | src/core/SkValidatingReadBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698