[poppler] 2 commits - poppler/ABWOutputDev.cc poppler/JBIG2Stream.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Apr 29 15:42:59 PDT 2008


 poppler/ABWOutputDev.cc |    2 +-
 poppler/JBIG2Stream.cc  |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c907e41ab18dda10cd3c9789bd0e7fe71b6402a8
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Apr 30 00:42:34 2008 +0200

    findSegment can return NULL check for it

diff --git a/poppler/JBIG2Stream.cc b/poppler/JBIG2Stream.cc
index 4d9157b..b696adb 100644
--- a/poppler/JBIG2Stream.cc
+++ b/poppler/JBIG2Stream.cc
@@ -1549,7 +1549,7 @@ GBool JBIG2Stream::readSymbolDictSeg(Guint segNum, Guint length,
   inputSymbolDict = NULL;
   for (i = 0; i < nRefSegs; ++i) {
     seg = findSegment(refSegs[i]);
-    if (seg->getType() == jbig2SegSymbolDict) {
+    if (seg != NULL && seg->getType() == jbig2SegSymbolDict) {
       inputSymbolDict = (JBIG2SymbolDict *)seg;
       for (j = 0; j < inputSymbolDict->getSize(); ++j) {
 	bitmaps[k++] = inputSymbolDict->getBitmap(j);
@@ -2382,7 +2382,7 @@ void JBIG2Stream::readHalftoneRegionSeg(Guint segNum, GBool imm,
     return;
   }
   seg = findSegment(refSegs[0]);
-  if (seg->getType() != jbig2SegPatternDict) {
+  if (seg == NULL || seg->getType() != jbig2SegPatternDict) {
     error(getPos(), "Bad symbol dictionary reference in JBIG2 halftone segment");
     return;
   }
@@ -2968,7 +2968,7 @@ void JBIG2Stream::readGenericRefinementRegionSeg(Guint segNum, GBool imm,
   }
   if (nRefSegs == 1) {
     seg = findSegment(refSegs[0]);
-    if (seg->getType() != jbig2SegBitmap) {
+    if (seg == NULL || seg->getType() != jbig2SegBitmap) {
       error(getPos(), "Bad bitmap reference in JBIG2 generic refinement segment");
       return;
     }
commit 8b7f29b577bca3295e99fea4a5cf4a6bb7ba2617
Author: Albert Astals Cid <aacid at kde.org>
Date:   Wed Apr 30 00:26:28 2008 +0200

    new[] implies delete[]

diff --git a/poppler/ABWOutputDev.cc b/poppler/ABWOutputDev.cc
index 0c8f9d5..9d9c21c 100644
--- a/poppler/ABWOutputDev.cc
+++ b/poppler/ABWOutputDev.cc
@@ -731,7 +731,7 @@ void ABWOutputDev::cleanUpNode(xmlNodePtr N_parent, bool aggregateInfo){
   if (N_parent->children && xmlStrcasecmp(N_parent->children->name,BAD_CAST "line") == 0 && xmlGetProp(N_parent->children,BAD_CAST "alignment") != NULL)
     xmlSetProp(N_parent, BAD_CAST "alignment", xmlGetProp(N_parent->children,BAD_CAST "alignment"));
 
-   delete styles;
+   delete[] styles;
 }
 
 void ABWOutputDev::generateParagraphs() {


More information about the poppler mailing list