Ignore:
Timestamp:
Dec 30, 2009, 7:13:45 PM (12 years ago)
Author:
rbri
Message:

PDF plugin: Poppler library updated to version 0.12.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/Parser.cc

    r257 r277  
    1414// under GPL version 2 or later
    1515//
    16 // Copyright (C) 2006 Albert Astals Cid <aacid@kde.org>
     16// Copyright (C) 2006, 2009 Albert Astals Cid <aacid@kde.org>
    1717// Copyright (C) 2006 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
    1818//
     
    210210  } else {
    211211    error(getPos(), "Missing 'endstream'");
    212     // kludge for broken PDF files: just add 5k to the length, and
    213     // hope its enough
    214     length += 5000;
     212    if (xref) {
     213      // shift until we find the proper endstream or we change to another object or reach eof
     214      while (!buf1.isCmd("endstream") && xref->getNumEntry(lexer->getPos()) == objNum && !buf1.isEOF()) {
     215        shift();
     216      }
     217      length = lexer->getPos() - pos;
     218      if (buf1.isCmd("endstream")) {
     219        obj.initInt(length);
     220        dict->dictSet("Length", &obj);
     221        obj.free();
     222      }
     223    } else {
     224      // When building the xref we can't use it so use this
     225      // kludge for broken PDF files: just add 5k to the length, and
     226      // hope its enough
     227      length += 5000;
     228    }
    215229  }
    216230
Note: See TracChangeset for help on using the changeset viewer.