diff options
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/parser/cxfa_localemgr.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp index 55ba04bbb0..fc3b1ce9cb 100644 --- a/xfa/fxfa/parser/cxfa_localemgr.cpp +++ b/xfa/fxfa/parser/cxfa_localemgr.cpp @@ -1071,17 +1071,15 @@ std::unique_ptr<LocaleIface> GetLocaleFromBuffer( if (src_span.empty()) return nullptr; - uint8_t* pOut = nullptr; + std::unique_ptr<uint8_t, FxFreeDeleter> output; uint32_t dwSize; CCodec_ModuleMgr* pCodecMgr = CPDF_ModuleMgr::Get()->GetCodecModule(); pCodecMgr->GetFlateModule()->FlateOrLZWDecode(false, src_span, true, 0, 0, 0, - 0, 0, &pOut, &dwSize); - if (!pOut) + 0, 0, &output, &dwSize); + if (!output) return nullptr; - auto locale = CXFA_XMLLocale::Create(pdfium::make_span(pOut, dwSize)); - FX_Free(pOut); - return locale; + return CXFA_XMLLocale::Create(pdfium::make_span(output.get(), dwSize)); } uint16_t GetLanguage(WideString wsLanguage) { |