Ignore:
Timestamp:
Oct 19, 2008, 4:08:46 PM (13 years ago)
Author:
Eugene Romanenko
Message:

PDF plugin: Poppler library updated to version 0.10.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/fofi/FoFiType1.cc

    r250 r257  
    44//
    55// Copyright 1999-2003 Glyph & Cog, LLC
     6//
     7//========================================================================
     8
     9//========================================================================
     10//
     11// Modified under the Poppler project - http://poppler.freedesktop.org
     12//
     13// All changes made under the Poppler project to this file are licensed
     14// under GPL version 2 or later
     15//
     16// Copyright (C) 2005, 2008 Albert Astals Cid <aacid@kde.org>
     17// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
     18//
     19// To see a description of the changes please see the Changelog file that
     20// came with your tarball or type make ChangeLog if you are building from git
    621//
    722//========================================================================
     
    1833#include "FoFiEncodings.h"
    1934#include "FoFiType1.h"
     35#include "poppler/Error.h"
    2036
    2137//------------------------------------------------------------------------
     
    206222           ++j, line = line1) {
    207223        if ((n = line1 - line) > 255) {
     224          error(-1, "FoFiType1::parse a line has more than 255 characters, we don't support this");
    208225          n = 255;
    209226        }
     
    215232          for (p2 = p; *p2 >= '0' && *p2 <= '9'; ++p2) ;
    216233          if (*p2) {
    217             c = *p2;
    218             *p2 = '\0';
     234            c = *p2; // store it so we can recover it after atoi
     235            *p2 = '\0'; // terminate p so atoi works
    219236            code = atoi(p);
    220237            *p2 = c;
     
    230247                ++p;
    231248                for (p2 = p; *p2 && *p2 != ' ' && *p2 != '\t'; ++p2) ;
    232                 *p2 = '\0';
     249                c = *p2; // store it so we can recover it after copyString
     250                *p2 = '\0'; // terminate p so copyString works
    233251                encoding[code] = copyString(p);
     252                *p2 = c;
     253                p = p2;
     254                for (; *p == ' ' || *p == '\t'; ++p); // eat spaces between string and put
     255                if (!strncmp(p, "put", 3)) {
     256                  // eat put and spaces and newlines after put
     257                  for (p += 3; *p == ' ' || *p == '\t' || *p == '\n' || *p == '\r'; ++p);
     258                  if (*p)
     259                  {
     260                    // there is still something after the definition
     261                    // there might be another definition in this line
     262                    // so move line1 to the end of our parsing
     263                    // so we start in the potential next definition in the next loop
     264                    line1 = &line[p - buf];
     265                  }
     266                } else {
     267                  error(-1, "FoFiType1::parse no put after dup");
     268                }
    234269              }
    235270            }
Note: See TracChangeset for help on using the changeset viewer.