summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-16 05:21:13 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-16 05:21:13 +0000
commit2e2acbdc523735fdbbf69b1f9fee9a24e4303045 (patch)
tree8faa4479c0e73771fc816791a97aa4c83f8769a1 /testing
parent6ea4d08b905de5fab7dc64f35b0abf745a1db3f3 (diff)
downloadpdfium-2e2acbdc523735fdbbf69b1f9fee9a24e4303045.tar.xz
Make {A85,RunLength}Encode()'s buffer out parameter a unique_ptr.
Change-Id: I3f06ea7ed39c8a8fff57e07f14ff6c21bedbc028 Reviewed-on: https://pdfium-review.googlesource.com/c/43998 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing')
-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;
}