OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "layout.h" | 5 #include "layout.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "gdef.h" | 10 #include "gdef.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
387 uint16_t last_start_coverage_index = 0; | 387 uint16_t last_start_coverage_index = 0; |
388 for (unsigned i = 0; i < range_count; ++i) { | 388 for (unsigned i = 0; i < range_count; ++i) { |
389 uint16_t start = 0; | 389 uint16_t start = 0; |
390 uint16_t end = 0; | 390 uint16_t end = 0; |
391 uint16_t start_coverage_index = 0; | 391 uint16_t start_coverage_index = 0; |
392 if (!subtable.ReadU16(&start) || | 392 if (!subtable.ReadU16(&start) || |
393 !subtable.ReadU16(&end) || | 393 !subtable.ReadU16(&end) || |
394 !subtable.ReadU16(&start_coverage_index)) { | 394 !subtable.ReadU16(&start_coverage_index)) { |
395 return OTS_FAILURE(); | 395 return OTS_FAILURE(); |
396 } | 396 } |
397 if (start > end || (last_end && start <= last_end)) { | 397 |
398 // Some of the Adobe Pro fonts have ranges that overlap by one element: the | |
399 // start of one range is equal to the end of the previous range. Therefore | |
400 // the < in the following condition should be <= were it not for this. | |
401 // See crbug.com/29937. | |
bashi
2012/06/25 22:23:31
crbug.com/134135 ?
agl
2012/06/26 14:43:27
Done. Thanks, that was the other bug that I was lo
| |
402 if (start > end || (last_end && start < last_end)) { | |
398 OTS_WARNING("glyph range is overlapping."); | 403 OTS_WARNING("glyph range is overlapping."); |
399 return OTS_FAILURE(); | 404 return OTS_FAILURE(); |
400 } | 405 } |
401 if (start_coverage_index != last_start_coverage_index) { | 406 if (start_coverage_index != last_start_coverage_index) { |
402 OTS_WARNING("bad start coverage index."); | 407 OTS_WARNING("bad start coverage index."); |
403 return OTS_FAILURE(); | 408 return OTS_FAILURE(); |
404 } | 409 } |
405 last_end = end; | 410 last_end = end; |
406 last_start_coverage_index += end - start + 1; | 411 last_start_coverage_index += end - start + 1; |
407 } | 412 } |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1468 if (!parser->Parse(file, data + offset_extension, length - offset_extension, | 1473 if (!parser->Parse(file, data + offset_extension, length - offset_extension, |
1469 lookup_type)) { | 1474 lookup_type)) { |
1470 return OTS_FAILURE(); | 1475 return OTS_FAILURE(); |
1471 } | 1476 } |
1472 | 1477 |
1473 return true; | 1478 return true; |
1474 } | 1479 } |
1475 | 1480 |
1476 } // namespace ots | 1481 } // namespace ots |
1477 | 1482 |
OLD | NEW |