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

Side by Side Diff: include/core/SkReader32.h

Issue 255693003: Fixed issue found by clusterfuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed nit Created 6 years, 7 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 | « no previous file | 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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 8
9 9
10 #ifndef SkReader32_DEFINED 10 #ifndef SkReader32_DEFINED
(...skipping 22 matching lines...) Expand all
33 fStop = (const char*)data + size; 33 fStop = (const char*)data + size;
34 } 34 }
35 35
36 size_t size() const { return fStop - fBase; } 36 size_t size() const { return fStop - fBase; }
37 size_t offset() const { return fCurr - fBase; } 37 size_t offset() const { return fCurr - fBase; }
38 bool eof() const { return fCurr >= fStop; } 38 bool eof() const { return fCurr >= fStop; }
39 const void* base() const { return fBase; } 39 const void* base() const { return fBase; }
40 const void* peek() const { return fCurr; } 40 const void* peek() const { return fCurr; }
41 41
42 size_t available() const { return fStop - fCurr; } 42 size_t available() const { return fStop - fCurr; }
43 bool isAvailable(size_t size) const { return fCurr + size <= fStop; } 43 bool isAvailable(size_t size) const { return size <= this->available(); }
44 44
45 void rewind() { fCurr = fBase; } 45 void rewind() { fCurr = fBase; }
46 46
47 void setOffset(size_t offset) { 47 void setOffset(size_t offset) {
48 SkASSERT(SkAlign4(offset) == offset); 48 SkASSERT(SkAlign4(offset) == offset);
49 SkASSERT(offset <= this->size()); 49 SkASSERT(offset <= this->size());
50 fCurr = fBase + offset; 50 fCurr = fBase + offset;
51 } 51 }
52 52
53 bool readBool() { return this->readInt() != 0; } 53 bool readBool() { return this->readInt() != 0; }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 const char* fBase; // beginning of buffer 151 const char* fBase; // beginning of buffer
152 152
153 #ifdef SK_DEBUG 153 #ifdef SK_DEBUG
154 static bool ptr_align_4(const void* ptr) { 154 static bool ptr_align_4(const void* ptr) {
155 return (((const char*)ptr - (const char*)NULL) & 3) == 0; 155 return (((const char*)ptr - (const char*)NULL) & 3) == 0;
156 } 156 }
157 #endif 157 #endif
158 }; 158 };
159 159
160 #endif 160 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkValidatingReadBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698