X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2Fpdf.cc;h=4bcf9b9f017ee54f54a2312273cfc1cc07ed6851;hb=cba26480d2932910cb2593c6e128c166c109c9e9;hp=c97825d4af7d033ed41502672d7fed8a66a5c561;hpb=d2238a05fee8463d460bbb4a0c22c021b560c096;p=swftools.git diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index c97825d..4bcf9b9 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -179,7 +179,7 @@ static char*getInfoString(Dict *infoDict, char *key) GString *s1, *s2; int i; - if (infoDict->lookup(key, &obj)->isString()) { + if (infoDict && infoDict->lookup(key, &obj)->isString()) { s1 = obj.getString(); if ((s1->getChar(0) & 0xff) == 0xfe && (s1->getChar(1) & 0xff) == 0xff) { @@ -211,7 +211,7 @@ static char*getInfoDate(Dict *infoDict, char *key) Object obj; char *s; - if (infoDict->lookup(key, &obj)->isString()) { + if (infoDict && infoDict->lookup(key, &obj)->isString()) { s = obj.getString()->getCString(); if (s[0] == 'D' && s[1] == ':') { s += 2; @@ -351,7 +351,7 @@ static gfxdocument_t*pdf_open(const char*filename) i->protect = 1; } - InfoOutputDev*io = new InfoOutputDev(); + InfoOutputDev*io = new InfoOutputDev(i->doc->getXRef()); int t; i->pages = (pdf_page_info_t*)malloc(sizeof(pdf_page_info_t)*pdf_doc->num_pages); memset(i->pages,0,sizeof(pdf_page_info_t)*pdf_doc->num_pages);