Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Side by Side Diff: testing/libfuzzer/pdf_hint_table_fuzzer.cc

Issue 2478303002: Reland "Remove CPDF_Object::Release() in favor of direct delete" (Closed)
Patch Set: Fix fuzzer build Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc ('k') | testing/libfuzzer/pdf_streamparser_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698