[PATCH] cairo: fix unique id mime data

Adrian Johnson ajohnson at redneon.com
Wed Aug 24 03:23:48 PDT 2011


The unique id string was copied before the object number was appended
resulting in all images in pdf output being the same.
---
 poppler/CairoOutputDev.cc |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 968788e..cec2039 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -2541,9 +2541,8 @@ void CairoOutputDev::setMimeData(Stream *str, Object *ref, cairo_surface_t *imag
     if (ref && ref->isRef()) {
       Ref imgRef = ref->getRef();
       GooString *surfaceId = new GooString("poppler-surface-");
-      char *idBuffer = copyString(surfaceId->getCString());
-
       surfaceId->appendf("{0:d}-{1:d}", imgRef.gen, imgRef.num);
+      char *idBuffer = copyString(surfaceId->getCString());
       st = cairo_surface_set_mime_data (image, CAIRO_MIME_TYPE_UNIQUE_ID,
                                         (const unsigned char *)idBuffer,
                                         surfaceId->getLength(),
-- 
1.7.4.1


--------------030607060307040603000907--


More information about the poppler mailing list