Index: core/fxcodec/jbig2/JBig2_Context.cpp |
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp |
index 1e4c35a6252d7bee2ef70e68580dabb1824b4dde..256ce3910a2484a0efbf76bfb24f492a9af1cbbf 100644 |
--- a/core/fxcodec/jbig2/JBig2_Context.cpp |
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp |
@@ -591,7 +591,8 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment, |
if (it->first == key) { |
std::unique_ptr<CJBig2_SymbolDict> copy(it->second->DeepCopy()); |
pSegment->m_Result.sd = copy.release(); |
- m_pSymbolDictCache->push_front(*it); |
+ m_pSymbolDictCache->push_front( |
+ CJBig2_CachePair(key, std::move(it->second))); |
m_pSymbolDictCache->erase(it); |
cache_hit = true; |
break; |
@@ -621,11 +622,10 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment, |
pSegment->m_Result.sd->DeepCopy(); |
int size = pdfium::CollectionSize<int>(*m_pSymbolDictCache); |
while (size >= kSymbolDictCacheMaxSize) { |
- delete m_pSymbolDictCache->back().second; |
m_pSymbolDictCache->pop_back(); |
--size; |
} |
- m_pSymbolDictCache->push_front(CJBig2_CachePair(key, value.release())); |
+ m_pSymbolDictCache->push_front(CJBig2_CachePair(key, std::move(value))); |
} |
} |
if (wFlags & 0x0200) { |