summaryrefslogtreecommitdiff
path: root/testing/fuzzers
diff options
context:
space:
mode:
Diffstat (limited to 'testing/fuzzers')
-rw-r--r--testing/fuzzers/pdf_codec_a85_fuzzer.cc3
-rw-r--r--testing/fuzzers/pdf_codec_rle_fuzzer.cc3
2 files changed, 2 insertions, 4 deletions
diff --git a/testing/fuzzers/pdf_codec_a85_fuzzer.cc b/testing/fuzzers/pdf_codec_a85_fuzzer.cc
index 0da713b831..e45b81fa5e 100644
--- a/testing/fuzzers/pdf_codec_a85_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_a85_fuzzer.cc
@@ -9,10 +9,9 @@
#include "core/fxcrt/fx_memory.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- uint8_t* dest_buf = nullptr;
+ std::unique_ptr<uint8_t, FxFreeDeleter> dest_buf;
uint32_t dest_size = 0;
CCodec_BasicModule encoder_module;
encoder_module.A85Encode({data, size}, &dest_buf, &dest_size);
- FX_Free(dest_buf);
return 0;
}
diff --git a/testing/fuzzers/pdf_codec_rle_fuzzer.cc b/testing/fuzzers/pdf_codec_rle_fuzzer.cc
index adf454ecbd..13c4a48c24 100644
--- a/testing/fuzzers/pdf_codec_rle_fuzzer.cc
+++ b/testing/fuzzers/pdf_codec_rle_fuzzer.cc
@@ -9,10 +9,9 @@
#include "core/fxcrt/fx_memory.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- uint8_t* dest_buf = nullptr;
+ std::unique_ptr<uint8_t, FxFreeDeleter> dest_buf;
uint32_t dest_size = 0;
CCodec_BasicModule encoder_module;
encoder_module.RunLengthEncode({data, size}, &dest_buf, &dest_size);
- FX_Free(dest_buf);
return 0;
}