summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-02-27 19:51:26 -0800
committerLei Zhang <thestig@chromium.org>2015-02-27 19:51:26 -0800
commit266dc920714f119562ef2bbf2f3af474539c36d7 (patch)
tree19fde87993e75e3d031ae1126dd5068f2802a2e3
parent659b8d3a3de770f8dc0e0334bda9748301403bae (diff)
downloadpdfium-266dc920714f119562ef2bbf2f3af474539c36d7.tar.xz
Merge to XFA: Check for NULL pointers in CJBig2_SymbolDict::DeepCopy().
Original URL: https://codereview.chromium.org/837093002 (cherry picked from commit f8105c665856863ad95da37fee6c12b98b953e2c) Review URL: https://codereview.chromium.org/967033002
-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;
}