| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // This is the implementation of decompression of the proposed WOFF Ultra | 5 // This is the implementation of decompression of the proposed WOFF Ultra |
| 6 // Condensed file format. | 6 // Condensed file format. |
| 7 | 7 |
| 8 #include <cassert> | 8 #include <cassert> |
| 9 #include <cstdlib> | 9 #include <cstdlib> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 glyf_dst, glyf_dst_size, &glyph_size)) { | 649 glyf_dst, glyf_dst_size, &glyph_size)) { |
| 650 return OTS_FAILURE(); | 650 return OTS_FAILURE(); |
| 651 } | 651 } |
| 652 } else { | 652 } else { |
| 653 glyph_size = 0; | 653 glyph_size = 0; |
| 654 } | 654 } |
| 655 loca_values.push_back(loca_offset); | 655 loca_values.push_back(loca_offset); |
| 656 if (glyph_size + 3 < glyph_size) { | 656 if (glyph_size + 3 < glyph_size) { |
| 657 return OTS_FAILURE(); | 657 return OTS_FAILURE(); |
| 658 } | 658 } |
| 659 glyph_size = ots::Round4(glyph_size); | 659 glyph_size = ots::Round2(glyph_size); |
| 660 if (glyph_size > dst_size - loca_offset) { | 660 if (glyph_size > dst_size - loca_offset) { |
| 661 // This shouldn't happen, but this test defensively maintains the | 661 // This shouldn't happen, but this test defensively maintains the |
| 662 // invariant that loca_offset <= dst_size. | 662 // invariant that loca_offset <= dst_size. |
| 663 return OTS_FAILURE(); | 663 return OTS_FAILURE(); |
| 664 } | 664 } |
| 665 loca_offset += glyph_size; | 665 loca_offset += glyph_size; |
| 666 } | 666 } |
| 667 loca_values.push_back(loca_offset); | 667 loca_values.push_back(loca_offset); |
| 668 assert(loca_values.size() == static_cast<size_t>(num_glyphs + 1)); | 668 assert(loca_values.size() == static_cast<size_t>(num_glyphs + 1)); |
| 669 if (!ProcessBboxStream(&bbox_stream, num_glyphs, loca_values, | 669 if (!ProcessBboxStream(&bbox_stream, num_glyphs, loca_values, |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 if (transform_buf > &uncompressed_buf[uncompressed_buf.size()]) { | 1028 if (transform_buf > &uncompressed_buf[uncompressed_buf.size()]) { |
| 1029 return OTS_FAILURE(); | 1029 return OTS_FAILURE(); |
| 1030 } | 1030 } |
| 1031 } | 1031 } |
| 1032 } | 1032 } |
| 1033 | 1033 |
| 1034 return FixChecksums(tables, result); | 1034 return FixChecksums(tables, result); |
| 1035 } | 1035 } |
| 1036 | 1036 |
| 1037 } // namespace ots | 1037 } // namespace ots |
| OLD | NEW |