| 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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 std::memcpy(result + table->dst_offset, transform_buf, | 1018 std::memcpy(result + table->dst_offset, transform_buf, |
| 1019 transform_length); | 1019 transform_length); |
| 1020 } else { | 1020 } else { |
| 1021 if (!ReconstructTransformed(tables, table->tag, | 1021 if (!ReconstructTransformed(tables, table->tag, |
| 1022 transform_buf, transform_length, result, result_length)) { | 1022 transform_buf, transform_length, result, result_length)) { |
| 1023 return OTS_FAILURE(); | 1023 return OTS_FAILURE(); |
| 1024 } | 1024 } |
| 1025 } | 1025 } |
| 1026 if (continue_valid) { | 1026 if (continue_valid) { |
| 1027 transform_buf += transform_length; | 1027 transform_buf += transform_length; |
| 1028 if (transform_buf > &uncompressed_buf[uncompressed_buf.size()]) { | 1028 if (transform_buf > &uncompressed_buf[0] + 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 |