X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=pdf%2Fxpdf%2FXRef.cc;h=56cb131c00251cd0fd5bf16379f7a2d8de4464ba;hb=884f739665dc56e66f51e104350f2affd33f2dd8;hp=0e1bbc9c6c620a4162cc2e7609fcad89bc1122e1;hpb=2a393c134fe3fe8eb85bf818cb7ad6ae4396322a;p=evince.git diff --git a/pdf/xpdf/XRef.cc b/pdf/xpdf/XRef.cc index 0e1bbc9c..56cb131c 100644 --- a/pdf/xpdf/XRef.cc +++ b/pdf/xpdf/XRef.cc @@ -2,15 +2,16 @@ // // XRef.cc // -// Copyright 1996-2002 Glyph & Cog, LLC +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== -#ifdef __GNUC__ +#include + +#ifdef USE_GCC_PRAGMAS #pragma implementation #endif -#include #include #include #include @@ -324,6 +325,11 @@ GBool XRef::readXRef(Guint *pos) { if (obj2.isInt()) { *pos = (Guint)obj2.getInt(); more = gTrue; + } else if (obj2.isRef()) { + // certain buggy PDF generators generate "/Prev NNN 0 R" instead + // of "/Prev NNN" + *pos = (Guint)obj2.getRefNum(); + more = gTrue; } else { more = gFalse; } @@ -454,6 +460,7 @@ GBool XRef::checkEncrypted(GString *ownerPassword, GString *userPassword) { ret = gFalse; permFlags = defPermFlags; + ownerPasswordOk = gFalse; trailerDict.dictLookup("Encrypt", &encrypt); if ((encrypted1 = encrypt.isDict())) { ret = gTrue;