Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: core/fxcodec/jbig2/JBig2_Context.cpp

Issue 2036203004: Fix some code which causes warnings when compiled by /analyze tool (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fxcodec/codec/fx_codec_png.cpp ('k') | fpdfsdk/fpdf_flatten.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxcodec/jbig2/JBig2_Context.h" 7 #include "core/fxcodec/jbig2/JBig2_Context.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <list> 10 #include <list>
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 624
625 m_pStream->alignByte(); 625 m_pStream->alignByte();
626 m_pStream->offset(2); 626 m_pStream->offset(2);
627 } else { 627 } else {
628 pSegment->m_Result.sd = pSymbolDictDecoder->decode_Huffman( 628 pSegment->m_Result.sd = pSymbolDictDecoder->decode_Huffman(
629 m_pStream.get(), &gbContext, &grContext, pPause); 629 m_pStream.get(), &gbContext, &grContext, pPause);
630 if (!pSegment->m_Result.sd) 630 if (!pSegment->m_Result.sd)
631 return JBIG2_ERROR_FATAL; 631 return JBIG2_ERROR_FATAL;
632 m_pStream->alignByte(); 632 m_pStream->alignByte();
633 } 633 }
634 if (m_bIsGlobal && kSymbolDictCacheMaxSize > 0) { 634 if (m_bIsGlobal) {
Tom Sepez 2016/06/03 18:11:46 This probably wanted to be an ifdef to remove this
635 std::unique_ptr<CJBig2_SymbolDict> value = 635 std::unique_ptr<CJBig2_SymbolDict> value =
636 pSegment->m_Result.sd->DeepCopy(); 636 pSegment->m_Result.sd->DeepCopy();
637 int size = pdfium::CollectionSize<int>(*m_pSymbolDictCache); 637 int size = pdfium::CollectionSize<int>(*m_pSymbolDictCache);
638 while (size >= kSymbolDictCacheMaxSize) { 638 while (size >= kSymbolDictCacheMaxSize) {
639 delete m_pSymbolDictCache->back().second; 639 delete m_pSymbolDictCache->back().second;
640 m_pSymbolDictCache->pop_back(); 640 m_pSymbolDictCache->pop_back();
641 --size; 641 --size;
642 } 642 }
643 m_pSymbolDictCache->push_front(CJBig2_CachePair(key, value.release())); 643 m_pSymbolDictCache->push_front(CJBig2_CachePair(key, value.release()));
644 } 644 }
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 SBSYMCODES[CURTEMP].code = CURCODE; 1402 SBSYMCODES[CURTEMP].code = CURCODE;
1403 CURCODE = CURCODE + 1; 1403 CURCODE = CURCODE + 1;
1404 } 1404 }
1405 CURTEMP = CURTEMP + 1; 1405 CURTEMP = CURTEMP + 1;
1406 } 1406 }
1407 CURLEN = CURLEN + 1; 1407 CURLEN = CURLEN + 1;
1408 } 1408 }
1409 FX_Free(LENCOUNT); 1409 FX_Free(LENCOUNT);
1410 FX_Free(FIRSTCODE); 1410 FX_Free(FIRSTCODE);
1411 } 1411 }
OLDNEW
« no previous file with comments | « core/fxcodec/codec/fx_codec_png.cpp ('k') | fpdfsdk/fpdf_flatten.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698