summaryrefslogtreecommitdiff
path: root/core/fxcodec/codec
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/codec')
-rw-r--r--core/fxcodec/codec/fx_codec_jbig.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fxcodec/codec/fx_codec_jbig.cpp b/core/fxcodec/codec/fx_codec_jbig.cpp
index 8d20894231..926541f07d 100644
--- a/core/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/fxcodec/codec/fx_codec_jbig.cpp
@@ -14,6 +14,7 @@
#include "core/fxcodec/jbig2/JBig2_Context.h"
#include "core/fxcodec/jbig2/JBig2_Image.h"
#include "core/fxcrt/fx_memory.h"
+#include "third_party/base/ptr_util.h"
JBig2_DocumentContext::JBig2_DocumentContext() {}
@@ -22,7 +23,7 @@ JBig2_DocumentContext::~JBig2_DocumentContext() {}
JBig2_DocumentContext* GetJBig2DocumentContext(
std::unique_ptr<JBig2_DocumentContext>* pContextHolder) {
if (!pContextHolder->get())
- pContextHolder->reset(new JBig2_DocumentContext());
+ *pContextHolder = pdfium::MakeUnique<JBig2_DocumentContext>();
return pContextHolder->get();
}
@@ -62,9 +63,9 @@ FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(
pJbig2Context->m_dest_pitch = dest_pitch;
pJbig2Context->m_pPause = pPause;
FXSYS_memset(dest_buf, 0, height * dest_pitch);
- pJbig2Context->m_pContext.reset(new CJBig2_Context(
+ pJbig2Context->m_pContext = pdfium::MakeUnique<CJBig2_Context>(
global_stream, src_stream, pJBig2DocumentContext->GetSymbolDictCache(),
- pPause, false));
+ pPause, false);
if (!pJbig2Context->m_pContext)
return FXCODEC_STATUS_ERROR;