From 5dc0fe4407c41da62af13449e0d8302001d5be66 Mon Sep 17 00:00:00 2001
From: Matthias Kramm <kramm@quiss.org>
Date: Tue, 2 Mar 2010 11:57:29 -0800
Subject: [PATCH] fixed segfault in pdf2pdf

---
 lib/devices/pdf.c   |    1 +
 lib/pdf/Makefile.in |    2 ++
 2 files changed, 3 insertions(+)

diff --git a/lib/devices/pdf.c b/lib/devices/pdf.c
index 3183ce8..b96cda3 100644
--- a/lib/devices/pdf.c
+++ b/lib/devices/pdf.c
@@ -389,6 +389,7 @@ void pdf_addfont(gfxdevice_t*dev, gfxfont_t*font)
 	    for(t=0;t<num;t++) {
 		font->glyphs[t].unicode = 32+t;
 	    }
+	    font->max_unicode = 0;
 	    font->unicode2glyph = 0;
 	    gfxfont_save(font, filename);
 	    font->id=old_id;
diff --git a/lib/pdf/Makefile.in b/lib/pdf/Makefile.in
index 1c093c7..b700625 100644
--- a/lib/pdf/Makefile.in
+++ b/lib/pdf/Makefile.in
@@ -184,6 +184,8 @@ gfx_objects2 = $(gfx_objects) ../devices/lrf.$(O) ../libocr$(A)
 
 pdf2swf$(E): $(XPDFOK) ../../src/pdf2swf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects)
 	$(LL) $(CPPFLAGS) -g ../../src/pdf2swf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -o pdf2swf$(E) $(LIBS)
+pdf2pdf$(E): $(XPDFOK) ../../src/pdf2pdf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects)
+	$(LL) $(CPPFLAGS) -g ../../src/pdf2pdf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -o pdf2pdf$(E) $(LIBS)
 gfx2gfx$(E): $(XPDFOK) ../../src/gfx2gfx.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects2)
 	$(LL) $(CPPFLAGS) -g ../../src/gfx2gfx.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects2) -o gfx2gfx$(E) $(LIBS)
 
-- 
1.7.10.4