| 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 "../../../include/fxcodec/fx_codec.h" | 7 #include "../../../include/fxcodec/fx_codec.h" | 
| 8 #include "codec_int.h" | 8 #include "codec_int.h" | 
| 9 | 9 | 
| 10 CCodec_Jbig2Context::CCodec_Jbig2Context() { | 10 CCodec_Jbig2Context::CCodec_Jbig2Context() { | 
| 11   FXSYS_memset(this, 0, sizeof(CCodec_Jbig2Context)); | 11   FXSYS_memset(this, 0, sizeof(CCodec_Jbig2Context)); | 
| 12 } | 12 } | 
| 13 CCodec_Jbig2Module::~CCodec_Jbig2Module() {} | 13 | 
|  | 14 CCodec_Jbig2Module::~CCodec_Jbig2Module() { | 
|  | 15   for (auto it : m_SymbolDictCache) { | 
|  | 16     delete it.second; | 
|  | 17   } | 
|  | 18 } | 
|  | 19 | 
| 14 void* CCodec_Jbig2Module::CreateJbig2Context() { | 20 void* CCodec_Jbig2Module::CreateJbig2Context() { | 
| 15   return new CCodec_Jbig2Context(); | 21   return new CCodec_Jbig2Context(); | 
| 16 } | 22 } | 
| 17 void CCodec_Jbig2Module::DestroyJbig2Context(void* pJbig2Content) { | 23 void CCodec_Jbig2Module::DestroyJbig2Context(void* pJbig2Content) { | 
| 18   if (pJbig2Content) { | 24   if (pJbig2Content) { | 
| 19     CJBig2_Context::DestroyContext( | 25     CJBig2_Context::DestroyContext( | 
| 20         ((CCodec_Jbig2Context*)pJbig2Content)->m_pContext); | 26         ((CCodec_Jbig2Context*)pJbig2Content)->m_pContext); | 
| 21     delete (CCodec_Jbig2Context*)pJbig2Content; | 27     delete (CCodec_Jbig2Context*)pJbig2Content; | 
| 22   } | 28   } | 
| 23   pJbig2Content = NULL; | 29   pJbig2Content = NULL; | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 97     return FXCODEC_STATUS_ERROR; | 103     return FXCODEC_STATUS_ERROR; | 
| 98   } | 104   } | 
| 99   int dword_size = | 105   int dword_size = | 
| 100       m_pJbig2Context->m_height * m_pJbig2Context->m_dest_pitch / 4; | 106       m_pJbig2Context->m_height * m_pJbig2Context->m_dest_pitch / 4; | 
| 101   FX_DWORD* dword_buf = (FX_DWORD*)m_pJbig2Context->m_dest_buf; | 107   FX_DWORD* dword_buf = (FX_DWORD*)m_pJbig2Context->m_dest_buf; | 
| 102   for (int i = 0; i < dword_size; i++) { | 108   for (int i = 0; i < dword_size; i++) { | 
| 103     dword_buf[i] = ~dword_buf[i]; | 109     dword_buf[i] = ~dword_buf[i]; | 
| 104   } | 110   } | 
| 105   return FXCODEC_STATUS_DECODE_FINISH; | 111   return FXCODEC_STATUS_DECODE_FINISH; | 
| 106 } | 112 } | 
| OLD | NEW | 
|---|