fuzzers: avoid double initialization in CCodec_ModuleMgr
testing/fuzzers/pdf_fuzzer_init.cc is already doing a full library
init, so the call here was redundant. It was a silent no-op prior to
the latest module init changes, but now is caught.
Bug: chromium:970137
Change-Id: I24bf57d18395a3e620af3a6cb03cf88748c9e255
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/55530
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/fuzzers/xfa_codec_fuzzer.h b/testing/fuzzers/xfa_codec_fuzzer.h
index 2729963..9a44cc9 100644
--- a/testing/fuzzers/xfa_codec_fuzzer.h
+++ b/testing/fuzzers/xfa_codec_fuzzer.h
@@ -37,16 +37,7 @@
class XFACodecFuzzer {
public:
static int Fuzz(const uint8_t* data, size_t size, FXCODEC_IMAGE_TYPE type) {
- CCodec_ModuleMgr::Create();
- int sts = FuzzInternal(CCodec_ModuleMgr::GetInstance(), data, size, type);
- CCodec_ModuleMgr::Destroy();
- return sts;
- }
-
- static int FuzzInternal(CCodec_ModuleMgr* mgr,
- const uint8_t* data,
- size_t size,
- FXCODEC_IMAGE_TYPE type) {
+ auto* mgr = CCodec_ModuleMgr::GetInstance();
#ifdef PDF_ENABLE_XFA_BMP
mgr->SetBmpModule(pdfium::MakeUnique<CCodec_BmpModule>());
#endif // PDF_ENABLE_XFA_BMP