summaryrefslogtreecommitdiff
path: root/testing/libfuzzer/pdf_cmap_fuzzer.cc
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-24 11:07:31 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-03-24 19:16:51 +0000
commit4a58d1427f8a1b105578f2d27391ceda238ca59c (patch)
tree95d526e6dbe8f37008eed21194190c54b1f7864a /testing/libfuzzer/pdf_cmap_fuzzer.cc
parent73b607fcb5f904893a0610b2c7fb8726d09379e6 (diff)
downloadpdfium-4a58d1427f8a1b105578f2d27391ceda238ca59c.tar.xz
Refcount CPDF_CMap all the time.chromium/3052chromium/3051
Change-Id: I85ea9529f4188bf818ee96c37944e4546411f79c Reviewed-on: https://pdfium-review.googlesource.com/3211 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/libfuzzer/pdf_cmap_fuzzer.cc')
-rw-r--r--testing/libfuzzer/pdf_cmap_fuzzer.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/libfuzzer/pdf_cmap_fuzzer.cc b/testing/libfuzzer/pdf_cmap_fuzzer.cc
index 1e1ade7e19..ef0f684212 100644
--- a/testing/libfuzzer/pdf_cmap_fuzzer.cc
+++ b/testing/libfuzzer/pdf_cmap_fuzzer.cc
@@ -5,9 +5,10 @@
#include <cstdint>
#include "core/fpdfapi/font/font_int.h"
+#include "third_party/base/ptr_util.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- CPDF_CMap cmap;
- cmap.LoadEmbedded(data, size);
+ auto cmap = pdfium::MakeRetain<CPDF_CMap>();
+ cmap->LoadEmbedded(data, size);
return 0;
}