~ubuntu-branches/ubuntu/dapper/poppler/dapper-security

« back to all changes in this revision

Viewing changes to poppler/Lexer.cc

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-03-06 18:42:44 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060306184244-oomqyiqr7cgncp2c
Tags: 0.5.1-0ubuntu1
* New upstream version:
  - Support for embedded files.
  - Handle 0-width lines correctly.
  - Avoid external file use when opening fonts.
  - Only use vector fonts returned from fontconfig (#5758).
  - Fix scaled 1x1 pixmaps use for drawing lines (#3387).
  - drawSoftMaskedImage support in cairo backend.
  - Misc bug fixes: #5922, #5946, #5749, #5952, #4030, #5420.
* debian/control.in, debian/libpoppler0c2.dirs, 
  debian/libpoppler0c2-glib.dirs, debian/libpoppler0c2-glib.install,
  debian/libpoppler0c2.install, debian/libpoppler0c2-qt.dirs,
  debian/libpoppler0c2-qt.install, debian/rules:
  - updated for the soname change
* debian/patches/000_splash_build_fix.patch:
  - fix build when using splash
* debian/patches/001_fixes_for_fonts_selection.patch:
  - fix with the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <ctype.h>
19
19
#include "Lexer.h"
20
20
#include "Error.h"
 
21
#include "XRef.h"
21
22
 
22
23
//------------------------------------------------------------------------
23
24
 
46
47
// Lexer
47
48
//------------------------------------------------------------------------
48
49
 
49
 
Lexer::Lexer(XRef *xref, Stream *str) {
 
50
Lexer::Lexer(XRef *xrefA, Stream *str) {
50
51
  Object obj;
51
52
 
 
53
  xref = xrefA;
 
54
 
52
55
  curStr.initStream(str);
53
56
  streams = new Array(xref);
54
57
  streams->add(curStr.copy(&obj));
57
60
  curStr.streamReset();
58
61
}
59
62
 
60
 
Lexer::Lexer(XRef *xref, Object *obj) {
 
63
Lexer::Lexer(XRef *xrefA, Object *obj) {
61
64
  Object obj2;
62
65
 
 
66
  xref = xrefA;
 
67
 
63
68
  if (obj->isStream()) {
64
69
    streams = new Array(xref);
65
70
    freeArray = gTrue;
108
113
  return curStr.streamLookChar();
109
114
}
110
115
 
111
 
Object *Lexer::getObj(Object *obj) {
 
116
Object *Lexer::getObj(Object *obj, int objNum) {
112
117
  char *p;
113
118
  int c, c2;
114
119
  GBool comment, neg, done;
291
296
            s->append(tokBuf, tokBufSize);
292
297
          p = tokBuf;
293
298
          n = 0;
 
299
          
 
300
          // we are growing see if the document is not malformed and we are growing too much
 
301
          if (objNum != -1)
 
302
          {
 
303
            int newObjNum = xref->getNumEntry(getPos());
 
304
            if (newObjNum != objNum)
 
305
            {
 
306
              error(getPos(), "Unterminated string");
 
307
              done = gTrue;
 
308
            }
 
309
          }
294
310
        }
295
311
        *p++ = (char)c2;
296
312
        ++n;