[poppler] poppler/Movie.cc

Pino Toscano pino at kemper.freedesktop.org
Fri Aug 22 16:47:08 PDT 2008


 poppler/Movie.cc |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 820f15009845870701e1f4e7f4fc4fb93312ab3e
Author: Pino Toscano <pino at kde.org>
Date:   Sat Aug 23 01:45:07 2008 +0200

    fix Movie::copy()
    
    the default copy ctor already does the vertbatim copies, so no need to
    do them on our own; what needs to be done is checking whether an object
    is valid before either doing a "smart copy" or "postprocessing" it

diff --git a/poppler/Movie.cc b/poppler/Movie.cc
index 66b87dd..f0a4796 100644
--- a/poppler/Movie.cc
+++ b/poppler/Movie.cc
@@ -431,14 +431,16 @@ Movie* Movie::copy() {
   // call default copy constructor
   Movie* new_movie = new Movie(*this);
 
-  new_movie->contentType = contentType->copy();
-  new_movie->fileName = fileName->copy();
+  if (contentType)
+    new_movie->contentType = contentType->copy();
+  if (fileName)
+    new_movie->fileName = fileName->copy();
 
-  new_movie->embeddedStream = embeddedStream;
-  new_movie->embeddedStream->incRef();
+  if (new_movie->embeddedStream)
+    new_movie->embeddedStream->incRef();
   
-  new_movie->posterStream = posterStream;
-  new_movie->posterStream->incRef();
+  if (new_movie->posterStream)
+    new_movie->posterStream->incRef();
 
   return new_movie;
 }


More information about the poppler mailing list