summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-01-09 15:33:19 -0800
committerLei Zhang <thestig@chromium.org>2015-01-09 15:33:19 -0800
commitf8105c665856863ad95da37fee6c12b98b953e2c (patch)
tree02ed166abddbec772678c1cb66795f2f44bae935 /core/src/fxcodec/jbig2
parent5621dc444be3d2a5f7c6198b1e14695118a346a5 (diff)
downloadpdfium-f8105c665856863ad95da37fee6c12b98b953e2c.tar.xz
Check for NULL pointers in CJBig2_SymbolDict::DeepCopy().chromium/2276chromium/2275chromium/2274chromium/2273
BUG=445475 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/837093002
Diffstat (limited to 'core/src/fxcodec/jbig2')
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
index bad2fc4bce..e9bb9c62e0 100644
--- a/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_SymbolDict.cpp
@@ -27,8 +27,12 @@ CJBig2_SymbolDict *CJBig2_SymbolDict::DeepCopy()
dst->SDEXSYMS = (CJBig2_Image**)m_pModule->JBig2_Malloc2(
sizeof(CJBig2_Image*), src->SDNUMEXSYMS);
for(FX_DWORD i = 0; i < src->SDNUMEXSYMS; i++) {
- JBIG2_ALLOC(dst->SDEXSYMS[i],
- CJBig2_Image(*(src->SDEXSYMS[i])));
+ if (src->SDEXSYMS[i]) {
+ JBIG2_ALLOC(dst->SDEXSYMS[i],
+ CJBig2_Image(*(src->SDEXSYMS[i])));
+ } else {
+ dst->SDEXSYMS[i] = NULL;
+ }
}
return dst;
}