OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. |
3 * Copyright © 2012 Google, Inc. | 3 * Copyright © 2012 Google, Inc. |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 inline void init (hb_blob_t *b) | 187 inline void init (hb_blob_t *b) |
188 { | 188 { |
189 this->blob = hb_blob_reference (b); | 189 this->blob = hb_blob_reference (b); |
190 this->writable = false; | 190 this->writable = false; |
191 } | 191 } |
192 | 192 |
193 inline void start_processing (void) | 193 inline void start_processing (void) |
194 { | 194 { |
195 this->start = hb_blob_get_data (this->blob, NULL); | 195 this->start = hb_blob_get_data (this->blob, NULL); |
196 this->end = this->start + hb_blob_get_length (this->blob); | 196 this->end = this->start + hb_blob_get_length (this->blob); |
| 197 assert (this->start <= this->end); /* Must not overflow. */ |
197 this->edit_count = 0; | 198 this->edit_count = 0; |
198 this->debug_depth = 0; | 199 this->debug_depth = 0; |
199 | 200 |
200 DEBUG_MSG_LEVEL (SANITIZE, start, 0, +1, | 201 DEBUG_MSG_LEVEL (SANITIZE, start, 0, +1, |
201 "start [%p..%p] (%lu bytes)", | 202 "start [%p..%p] (%lu bytes)", |
202 this->start, this->end, | 203 this->start, this->end, |
203 (unsigned long) (this->end - this->start)); | 204 (unsigned long) (this->end - this->start)); |
204 } | 205 } |
205 | 206 |
206 inline void end_processing (void) | 207 inline void end_processing (void) |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 } | 999 } |
999 return -1; | 1000 return -1; |
1000 } | 1001 } |
1001 }; | 1002 }; |
1002 | 1003 |
1003 | 1004 |
1004 } /* namespace OT */ | 1005 } /* namespace OT */ |
1005 | 1006 |
1006 | 1007 |
1007 #endif /* HB_OPEN_TYPE_PRIVATE_HH */ | 1008 #endif /* HB_OPEN_TYPE_PRIVATE_HH */ |
OLD | NEW |