[poppler] poppler/Annot.cc poppler/Annot.h

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Fri Dec 14 05:12:46 PST 2007


 poppler/Annot.cc |   18 ++++++++----------
 poppler/Annot.h  |    1 +
 2 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit cb2a997aa6f9dd5508ca8b04e63815da893497ef
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri Dec 14 14:12:14 2007 +0100

    Fix another crash due to uninitialized variables

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 9087b05..dea725a 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -84,8 +84,14 @@ AnnotExternalDataType parseAnnotExternalData(Dict* dict) {
 //------------------------------------------------------------------------
 // AnnotBorder
 //------------------------------------------------------------------------
- 
-AnnotBorder::~AnnotBorder() { 
+AnnotBorder::AnnotBorder() {
+  width = 1;
+  dashLength = 0;
+  dash = NULL;
+  style = borderSolid;
+}
+
+AnnotBorder::~AnnotBorder() {
   if (dash)
     gfree (dash); 
 }
@@ -97,10 +103,6 @@ AnnotBorder::~AnnotBorder() {
 AnnotBorderArray::AnnotBorderArray() {
   horizontalCorner = 0;
   verticalCorner = 0;
-  width = 1;
-  dashLength = 0;
-  dash = NULL;
-  style = borderSolid;
 }
 
 AnnotBorderArray::AnnotBorderArray(Array *array) {
@@ -158,10 +160,6 @@ AnnotBorderArray::AnnotBorderArray(Array *array) {
 //------------------------------------------------------------------------
 
 AnnotBorderBS::AnnotBorderBS() {
-  width = 1;
-  dashLength = 0;
-  dash = NULL;
-  style = borderSolid;
 }
 
 AnnotBorderBS::AnnotBorderBS(Dict *dict) {
diff --git a/poppler/Annot.h b/poppler/Annot.h
index a08ff96..555285e 100644
--- a/poppler/Annot.h
+++ b/poppler/Annot.h
@@ -41,6 +41,7 @@ public:
     borderUnderlined, // Underlined
   };
 
+  AnnotBorder();
   virtual ~AnnotBorder();
 
   virtual double getWidth() const { return width; }


More information about the poppler mailing list