qt4/src/poppler-link.h   |    6 +++---
 qt4/src/poppler-media.cc |    6 ++++++
 qt4/src/poppler-media.h  |    5 ++++-
 qt4/src/poppler-page.cc  |    4 ++--
 4 files changed, 15 insertions(+), 6 deletions(-)

New commits:
commit fcc14682899ff4981bfece74dbc8c290a625b05c
Merge: f11e216 e6559a0
Author: Albert Astals Cid <[email protected]>
Date:   Sun Apr 7 17:44:12 2013 +0200

    Merge remote-tracking branch 'origin/poppler-0.22'

commit e6559a0d836df127ed5061794dc737d435ef534c
Author: Albert Astals Cid <[email protected]>
Date:   Sun Apr 7 17:42:23 2013 +0200

    Fix crash in KDE bug #317710
    
    It is not guaranteed that the ::LinkAction passed to 
PageData::convertLinkActionToLink
    will be always around (e.g. Page::action deletes it) so make a copy of the 
::MediaRendition object

diff --git a/qt4/src/poppler-link.h b/qt4/src/poppler-link.h
index ef93bf0..2c4bb55 100644
--- a/qt4/src/poppler-link.h
+++ b/qt4/src/poppler-link.h
@@ -1,5 +1,5 @@
 /* poppler-link.h: qt interface to poppler
- * Copyright (C) 2006, Albert Astals Cid <[email protected]>
+ * Copyright (C) 2006, 2013, Albert Astals Cid <[email protected]>
  * Copyright (C) 2007-2008, 2010, Pino Toscano <[email protected]>
  * Copyright (C) 2010, 2012, Guillermo Amaral <[email protected]>
  * Copyright (C) 2012, Tobias Koenig <[email protected]>
@@ -471,7 +471,7 @@ class POPPLER_QT4_EXPORT LinkRendition : public Link
                 * Create a new rendition link.
                 *
                 * \param linkArea the active area of the link
-                * \param rendition the media rendition object
+                * \param rendition the media rendition object. Ownership is 
taken
                 *
                 * \deprecated Use the constructor that takes all parameter 
instead
                 */
@@ -481,7 +481,7 @@ class POPPLER_QT4_EXPORT LinkRendition : public Link
                 * Create a new rendition link.
                 *
                 * \param linkArea the active area of the link
-                * \param rendition the media rendition object
+                * \param rendition the media rendition object. Ownership is 
taken
                 * \param operation the numeric operation (action) (@see 
::LinkRendition::RenditionOperation)
                 * \param script the java script code
                 * \param annotationReference the object reference of the 
screen annotation associated with this rendition action
diff --git a/qt4/src/poppler-media.cc b/qt4/src/poppler-media.cc
index c318147..1757fdb 100644
--- a/qt4/src/poppler-media.cc
+++ b/qt4/src/poppler-media.cc
@@ -1,5 +1,6 @@
 /* poppler-media.cc: qt interface to poppler
  * Copyright (C) 2012 Guillermo A. Amaral B. <[email protected]>
+ * Copyright (C) 2013 Albert Astals Cid <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,6 +38,11 @@ public:
   : rendition(rendition)
   {
   }
+  
+  ~MediaRenditionPrivate()
+  {
+    delete rendition;
+  }
 
   ::MediaRendition *rendition;
 };
diff --git a/qt4/src/poppler-media.h b/qt4/src/poppler-media.h
index 64ec83c..34e5c36 100644
--- a/qt4/src/poppler-media.h
+++ b/qt4/src/poppler-media.h
@@ -1,6 +1,6 @@
 /* poppler-media.h: qt interface to poppler
  * Copyright (C) 2012 Guillermo A. Amaral B. <[email protected]>
- * Copyright (C) 2012 Albert Astals Cid <[email protected]>
+ * Copyright (C) 2012, 2013 Albert Astals Cid <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -39,6 +39,9 @@ namespace Poppler
    */
   class POPPLER_QT4_EXPORT MediaRendition {
    public:
+    /**
+      Constructs a MediaRendition. Takes ownership of the passed rendition
+     */
     MediaRendition(::MediaRendition *rendition);
     ~MediaRendition();
 
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index 5475614..c6d56ed 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -1,7 +1,7 @@
 /* poppler-page.cc: qt interface to poppler
  * Copyright (C) 2005, Net Integration Technologies, Inc.
  * Copyright (C) 2005, Brad Hards <[email protected]>
- * Copyright (C) 2005-2012, Albert Astals Cid <[email protected]>
+ * Copyright (C) 2005-2013, Albert Astals Cid <[email protected]>
  * Copyright (C) 2005, Stefan Kebekus <[email protected]>
  * Copyright (C) 2006-2011, Pino Toscano <[email protected]>
  * Copyright (C) 2008 Carlos Garcia Campos <[email protected]>
@@ -204,7 +204,7 @@ Link* PageData::convertLinkActionToLink(::LinkAction * a, 
DocumentData *parentDo
       if ( lrn->hasScreenAnnot() )
         reference = lrn->getScreenAnnot();
 
-      popplerLink = new LinkRendition( linkArea, lrn->getMedia(), 
lrn->getOperation(), UnicodeParsedString( lrn->getScript() ), reference );
+      popplerLink = new LinkRendition( linkArea, lrn->getMedia()->copy(), 
lrn->getOperation(), UnicodeParsedString( lrn->getScript() ), reference );
     }
     break;
 
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to