From 0983af6ba15f2969fa6e0ec068ffe34635ea0c88 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Tue, 25 Aug 2009 18:09:09 +0200 Subject: [PATCH] applied getinfo_crash.patch and info_only.patch by Ricardo Pedroso --- lib/pdf/pdf.cc | 2 +- src/pdf2swf.c | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index 5cada51..1a6969d 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -390,7 +390,7 @@ char* pdf_doc_getinfo(gfxdocument_t*doc, const char*name) sprintf(buf, "%.1f", i->doc->getPDFVersion()); return strdup(buf); } - return 0; + return strdup(""); } diff --git a/src/pdf2swf.c b/src/pdf2swf.c index 4255fbf..f2425c7 100644 --- a/src/pdf2swf.c +++ b/src/pdf2swf.c @@ -640,18 +640,20 @@ int main(int argn, char *argv[]) exit(1); } - if(!outputname) - { - if(filename) { - outputname = stripFilename(filename, ".swf"); - msg(" Output filename not given. Writing to %s", outputname); - } - } - - if(!outputname) - { - fprintf(stderr, "Please use -o to specify an output file\n"); - exit(1); + if (!info_only) { + if(!outputname) + { + if(filename) { + outputname = stripFilename(filename, ".swf"); + msg(" Output filename not given. Writing to %s", outputname); + } + } + + if(!outputname) + { + fprintf(stderr, "Please use -o to specify an output file\n"); + exit(1); + } } // test if the page range is o.k. -- 1.7.10.4