| 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 "JBig2_Segment.h" | 7 #include "JBig2_Segment.h" |
| 8 | 8 |
| 9 #include "../../../include/fxcrt/fx_memory.h" | 9 #include "../../../include/fxcrt/fx_memory.h" |
| 10 | 10 |
| 11 CJBig2_Segment::CJBig2_Segment() { | 11 CJBig2_Segment::CJBig2_Segment() { |
| 12 m_dwNumber = 0; | 12 m_dwNumber = 0; |
| 13 m_cFlags.c = 0; | 13 m_cFlags.c = 0; |
| 14 m_nReferred_to_segment_count = 0; | 14 m_nReferred_to_segment_count = 0; |
| 15 m_pReferred_to_segment_numbers = NULL; | 15 m_pReferred_to_segment_numbers = NULL; |
| 16 m_dwPage_association = 0; | 16 m_dwPage_association = 0; |
| 17 m_dwData_length = 0; | 17 m_dwData_length = 0; |
| 18 m_dwHeader_Length = 0; | 18 m_dwHeader_Length = 0; |
| 19 m_pData = NULL; | 19 m_dwObjNum = 0; |
| 20 m_dwDataOffset = 0; |
| 20 m_State = JBIG2_SEGMENT_HEADER_UNPARSED; | 21 m_State = JBIG2_SEGMENT_HEADER_UNPARSED; |
| 21 m_nResultType = JBIG2_VOID_POINTER; | 22 m_nResultType = JBIG2_VOID_POINTER; |
| 22 m_Result.vd = NULL; | 23 m_Result.vd = NULL; |
| 23 } | 24 } |
| 24 CJBig2_Segment::~CJBig2_Segment() { | 25 CJBig2_Segment::~CJBig2_Segment() { |
| 25 FX_Free(m_pReferred_to_segment_numbers); | 26 FX_Free(m_pReferred_to_segment_numbers); |
| 26 | 27 |
| 27 switch (m_nResultType) { | 28 switch (m_nResultType) { |
| 28 case JBIG2_IMAGE_POINTER: | 29 case JBIG2_IMAGE_POINTER: |
| 29 delete m_Result.im; | 30 delete m_Result.im; |
| 30 break; | 31 break; |
| 31 case JBIG2_SYMBOL_DICT_POINTER: | 32 case JBIG2_SYMBOL_DICT_POINTER: |
| 32 delete m_Result.sd; | 33 delete m_Result.sd; |
| 33 break; | 34 break; |
| 34 case JBIG2_PATTERN_DICT_POINTER: | 35 case JBIG2_PATTERN_DICT_POINTER: |
| 35 delete m_Result.pd; | 36 delete m_Result.pd; |
| 36 break; | 37 break; |
| 37 case JBIG2_HUFFMAN_TABLE_POINTER: | 38 case JBIG2_HUFFMAN_TABLE_POINTER: |
| 38 delete m_Result.ht; | 39 delete m_Result.ht; |
| 39 break; | 40 break; |
| 40 default: | 41 default: |
| 41 FX_Free(m_Result.vd); | 42 FX_Free(m_Result.vd); |
| 42 } | 43 } |
| 43 } | 44 } |
| OLD | NEW |