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

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

Issue 116773002: Fixed more fuzzer issues (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Changed isAvailable for validateAvailable 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
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bool validate(bool isValid) SK_OVERRIDE; 63 virtual bool validate(bool isValid) SK_OVERRIDE;
64 virtual bool isValid() const SK_OVERRIDE; 64 virtual bool isValid() const SK_OVERRIDE;
65 65
66 virtual bool validateAvailable(size_t size) SK_OVERRIDE;
67
66 private: 68 private:
67 bool readArray(void* value, size_t size, size_t elementSize); 69 bool readArray(void* value, size_t size, size_t elementSize);
68 70
69 void setMemory(const void* data, size_t size); 71 void setMemory(const void* data, size_t size);
70 72
71 static bool IsPtrAlign4(const void* ptr) { 73 static bool IsPtrAlign4(const void* ptr) {
72 return SkIsAlign4((uintptr_t)ptr); 74 return SkIsAlign4((uintptr_t)ptr);
73 } 75 }
74 76
75 SkReader32 fReader; 77 SkReader32 fReader;
76 bool fError; 78 bool fError;
77 79
78 typedef SkFlattenableReadBuffer INHERITED; 80 typedef SkFlattenableReadBuffer INHERITED;
79 }; 81 };
80 82
81 #endif // SkValidatingReadBuffer_DEFINED 83 #endif // SkValidatingReadBuffer_DEFINED
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698