Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |