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

Unified Diff: testing/libfuzzer/pdf_hint_table_fuzzer.cc

Issue 2510223002: Make CPDF_Dictionary use unique pointers. (Closed)
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/javascript/Document.cpp ('k') | xfa/fxfa/app/xfa_fontmgr.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/pdf_hint_table_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_hint_table_fuzzer.cc b/testing/libfuzzer/pdf_hint_table_fuzzer.cc
index 15e04d9b3dc692bb4a76bbdb1060bdae7814fe32..b31d56eb8fb9c8f4d6edb7a2a2b4d38e12c5426e 100644
--- a/testing/libfuzzer/pdf_hint_table_fuzzer.cc
+++ b/testing/libfuzzer/pdf_hint_table_fuzzer.cc
@@ -5,6 +5,7 @@
#include <cstdint>
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_boolean.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_hint_tables.h"
#include "core/fpdfapi/parser/cpdf_linearized_header.h"
@@ -62,15 +63,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
auto linearized_dict = pdfium::MakeUnique<CPDF_Dictionary>();
// Set initial value.
- linearized_dict->SetBooleanFor("Linearized", true);
+ linearized_dict->SetNewFor<CPDF_Boolean>("Linearized", true);
// Set first page end offset
- linearized_dict->SetIntegerFor("E", GetData(&data32, &data, &size));
+ linearized_dict->SetNewFor<CPDF_Number>("E", GetData(&data32, &data, &size));
// Set page count
- linearized_dict->SetIntegerFor("N", GetData(&data32, &data, &size));
+ linearized_dict->SetNewFor<CPDF_Number>("N", GetData(&data32, &data, &size));
// Set first page obj num
- linearized_dict->SetIntegerFor("O", GetData(&data32, &data, &size));
+ linearized_dict->SetNewFor<CPDF_Number>("O", GetData(&data32, &data, &size));
// Set first page no
- linearized_dict->SetIntegerFor("P", GetData(&data32, &data, &size));
+ linearized_dict->SetNewFor<CPDF_Number>("P", GetData(&data32, &data, &size));
auto hint_info = pdfium::MakeUnique<CPDF_Array>();
// Add primary hint stream offset
@@ -78,7 +79,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Add primary hint stream size
hint_info->AddNew<CPDF_Number>(GetData(&data32, &data, &size));
// Set hint stream info.
- linearized_dict->SetFor("H", hint_info.release());
+ linearized_dict->SetFor("H", std::move(hint_info));
const int shared_hint_table_offset = GetData(&data32, &data, &size);
« no previous file with comments | « fpdfsdk/javascript/Document.cpp ('k') | xfa/fxfa/app/xfa_fontmgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698