[poppler] poppler/Gfx.cc poppler/OptionalContent.cc
Pino Toscano
pino at kemper.freedesktop.org
Wed Feb 27 09:05:44 PST 2008
poppler/Gfx.cc | 2 ++
poppler/OptionalContent.cc | 2 ++
2 files changed, 4 insertions(+)
New commits:
commit 4a324484b5c77ddc348746e7bcf6051ade28e389
Author: Pino Toscano <pino at kde.org>
Date: Wed Feb 27 18:04:52 2008 +0100
free some objects (thus leak less)
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index e8d0b1c..0618ab0 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -3460,6 +3460,8 @@ void Gfx::opXObject(Object args[], int numArgs) {
// No OC entry - so we proceed as normal
} else if (obj2.isRef()) {
if ( ! catalog->getOptContentConfig()->optContentIsVisible( &obj2 ) ) {
+ obj2.free();
+ obj1.free();
return;
}
} else {
diff --git a/poppler/OptionalContent.cc b/poppler/OptionalContent.cc
index 600c52b..b081add 100644
--- a/poppler/OptionalContent.cc
+++ b/poppler/OptionalContent.cc
@@ -174,6 +174,7 @@ bool OCGs::optContentIsVisible( Object *dictRef )
dictRef->fetch( m_xref, &dictObj );
if ( ! dictObj.isDict() ) {
printf( "Unexpected oc reference target: %i\n", dictObj.getType() );
+ dictObj.free();
return result;
}
dict = dictObj.getDict();
@@ -216,6 +217,7 @@ bool OCGs::optContentIsVisible( Object *dictRef )
}
}
dictType.free();
+ dictObj.free();
// printf("visibility: %s\n", result? "on" : "off");
return result;
}
More information about the poppler
mailing list