From 5110c4743751145c4ae1934cd1d83bc6c55bb43f Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Sat, 17 May 2014 22:33:34 -0700 Subject: Initial commit. --- core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp (limited to 'core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp') diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp new file mode 100644 index 0000000000..8516c045c6 --- /dev/null +++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp @@ -0,0 +1,34 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#include "JBig2_SymbolDict.h" +CJBig2_SymbolDict::CJBig2_SymbolDict() +{ + SDNUMEXSYMS = 0; + SDEXSYMS = NULL; + m_bContextRetained = FALSE; + m_gbContext = m_grContext = NULL; +} + +CJBig2_SymbolDict::~CJBig2_SymbolDict() +{ + if(SDEXSYMS) { + for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) { + if(SDEXSYMS[i]) { + delete SDEXSYMS[i]; + } + } + m_pModule->JBig2_Free(SDEXSYMS); + } + if(m_bContextRetained) { + if(m_gbContext) { + m_pModule->JBig2_Free(m_gbContext); + } + if(m_grContext) { + m_pModule->JBig2_Free(m_grContext); + } + } +} -- cgit v1.2.3