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/goo/gmem.cc

    r250 r257  
    66 * Copyright 1996-2003 Glyph & Cog, LLC
    77 */
     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 Takashi Iwai <tiwai@suse.de>
     17// Copyright (C) 2007, 2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2008 Jonathan Kew <jonathan_kew@sil.org>
     19//
     20// To see a description of the changes please see the Changelog file that
     21// came with your tarball or type make ChangeLog if you are building from git
     22//
     23//========================================================================
    824
    925#include <config.h>
     
    207223    fprintf(stderr, "Bogus memory allocation size\n");
    208224    exit(1);
     225#endif
     226  }
     227  return grealloc(p, n);
     228}
     229
     230void *greallocn_checkoverflow(void *p, int nObjs, int objSize) GMEM_EXCEP {
     231  int n;
     232
     233  if (nObjs == 0) {
     234    if (p) {
     235      gfree(p);
     236    }
     237    return NULL;
     238  }
     239  n = nObjs * objSize;
     240  if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
     241#if USE_EXCEPTIONS
     242    throw GMemException();
     243#else
     244    fprintf(stderr, "Bogus memory allocation size\n");
     245    return NULL;
    209246#endif
    210247  }
Note: See TracChangeset for help on using the changeset viewer.