diff options
author | Lei Zhang <thestig@chromium.org> | 2015-10-08 12:32:46 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-10-08 12:32:46 -0700 |
commit | d1cb813d23df38a8e21df3314658995ded7c4b45 (patch) | |
tree | 121280512f7b23d2648b86f04840f5ecb4493226 /core/src/fxcodec/jbig2/JBig2_SddProc.cpp | |
parent | 67fd5df1a378195ae3fb40c862a4e6e58731020a (diff) | |
download | pdfium-d1cb813d23df38a8e21df3314658995ded7c4b45.tar.xz |
Merge to XFA: Put CJBig2_SymbolDict's images in a CJBig2_List container.
Also mark it private.
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1395613003 .
(cherry picked from commit 8793b4a071fad51a770b93838e0752505b020e43)
Review URL: https://codereview.chromium.org/1397853002 .
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_SddProc.cpp')
-rw-r--r-- | core/src/fxcodec/jbig2/JBig2_SddProc.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_SddProc.cpp b/core/src/fxcodec/jbig2/JBig2_SddProc.cpp index 16f4a9024e..1d0393a7e3 100644 --- a/core/src/fxcodec/jbig2/JBig2_SddProc.cpp +++ b/core/src/fxcodec/jbig2/JBig2_SddProc.cpp @@ -258,24 +258,19 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith( CUREXFLAG = !CUREXFLAG; } pDict.reset(new CJBig2_SymbolDict); - pDict->SDNUMEXSYMS = SDNUMEXSYMS; - pDict->SDEXSYMS = FX_Alloc(CJBig2_Image*, SDNUMEXSYMS); I = J = 0; for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) { if (EXFLAGS[I] && J < SDNUMEXSYMS) { if (I < SDNUMINSYMS) { - pDict->SDEXSYMS[J] = new CJBig2_Image(*SDINSYMS[I]); + pDict->AddImage(new CJBig2_Image(*SDINSYMS[I])); } else { - pDict->SDEXSYMS[J] = SDNEWSYMS[I - SDNUMINSYMS]; + pDict->AddImage(SDNEWSYMS[I - SDNUMINSYMS]); } - J = J + 1; + ++J; } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) { delete SDNEWSYMS[I - SDNUMINSYMS]; } } - if (J < SDNUMEXSYMS) { - pDict->SDNUMEXSYMS = J; - } FX_Free(EXFLAGS); FX_Free(SDNEWSYMS); return pDict.release(); @@ -600,24 +595,19 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Huffman(CJBig2_BitStream* pStream, EXINDEX = EXINDEX + EXRUNLENGTH; CUREXFLAG = !CUREXFLAG; } - pDict->SDNUMEXSYMS = SDNUMEXSYMS; - pDict->SDEXSYMS = FX_Alloc(CJBig2_Image*, SDNUMEXSYMS); I = J = 0; for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) { if (EXFLAGS[I] && J < SDNUMEXSYMS) { if (I < SDNUMINSYMS) { - pDict->SDEXSYMS[J] = new CJBig2_Image(*SDINSYMS[I]); + pDict->AddImage(new CJBig2_Image(*SDINSYMS[I])); } else { - pDict->SDEXSYMS[J] = SDNEWSYMS[I - SDNUMINSYMS]; + pDict->AddImage(SDNEWSYMS[I - SDNUMINSYMS]); } - J = J + 1; + ++J; } else if (!EXFLAGS[I] && I >= SDNUMINSYMS) { delete SDNEWSYMS[I - SDNUMINSYMS]; } } - if (J < SDNUMEXSYMS) { - pDict->SDNUMEXSYMS = J; - } FX_Free(EXFLAGS); FX_Free(SDNEWSYMS); if (SDREFAGG == 0) { |