OLD | NEW |
1 // Copyright 2016 The PDFium Authors. All rights reserved. | 1 // Copyright 2016 The PDFium 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 <cstdint> | 5 #include <cstdint> |
6 | 6 |
7 #include "core/fpdfapi/parser/cpdf_dictionary.h" | 7 #include "core/fpdfapi/parser/cpdf_dictionary.h" |
8 #include "core/fpdfapi/parser/cpdf_hint_tables.h" | 8 #include "core/fpdfapi/parser/cpdf_hint_tables.h" |
9 | 9 |
10 struct DummyLinearizedDictionary { | 10 struct DummyLinearizedDictionary { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const int32_t* data32 = reinterpret_cast<const int32_t*>(data); | 75 const int32_t* data32 = reinterpret_cast<const int32_t*>(data); |
76 DummyLinearizedDictionary dummy_dict; | 76 DummyLinearizedDictionary dummy_dict; |
77 dummy_dict.end_of_first_page_offset = GetData(&data32, &data, &size); | 77 dummy_dict.end_of_first_page_offset = GetData(&data32, &data, &size); |
78 dummy_dict.number_of_pages = GetData(&data32, &data, &size); | 78 dummy_dict.number_of_pages = GetData(&data32, &data, &size); |
79 dummy_dict.first_page_object_number = GetData(&data32, &data, &size); | 79 dummy_dict.first_page_object_number = GetData(&data32, &data, &size); |
80 dummy_dict.first_page_number = GetData(&data32, &data, &size); | 80 dummy_dict.first_page_number = GetData(&data32, &data, &size); |
81 dummy_dict.primary_hint_stream_offset = GetData(&data32, &data, &size); | 81 dummy_dict.primary_hint_stream_offset = GetData(&data32, &data, &size); |
82 dummy_dict.primary_hint_stream_length = GetData(&data32, &data, &size); | 82 dummy_dict.primary_hint_stream_length = GetData(&data32, &data, &size); |
83 dummy_dict.shared_hint_table_offset = GetData(&data32, &data, &size); | 83 dummy_dict.shared_hint_table_offset = GetData(&data32, &data, &size); |
84 | 84 |
85 CPDF_Dictionary* dummy_linearized_dict = new CPDF_Dictionary; | 85 std::unique_ptr<CPDF_Dictionary> dummy_linearized_dict(new CPDF_Dictionary); |
86 | |
87 { | 86 { |
88 HintTableForFuzzing hint_table(&dummy_dict, dummy_linearized_dict); | 87 HintTableForFuzzing hint_table(&dummy_dict, dummy_linearized_dict.get()); |
89 hint_table.Fuzz(data, size); | 88 hint_table.Fuzz(data, size); |
90 } | 89 } |
91 | |
92 dummy_linearized_dict->Release(); | |
93 return 0; | 90 return 0; |
94 } | 91 } |
OLD | NEW |