X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=pdf%2Fxpdf%2FArray.cc;h=27ecbe9e7a1ae4a1559da5c3ac125d9ab71a4a5b;hb=884f739665dc56e66f51e104350f2affd33f2dd8;hp=9c6cb3415a5911531de6470379d941a0c07190c0;hpb=64676031423465996e83c4a685290f0c3d97a249;p=evince.git diff --git a/pdf/xpdf/Array.cc b/pdf/xpdf/Array.cc index 9c6cb341..27ecbe9e 100644 --- a/pdf/xpdf/Array.cc +++ b/pdf/xpdf/Array.cc @@ -2,7 +2,7 @@ // // Array.cc // -// Copyright 1996-2002 Glyph & Cog, LLC +// Copyright 1996-2003 Glyph & Cog, LLC // //======================================================================== @@ -12,6 +12,7 @@ #pragma implementation #endif +#include #include #include "gmem.h" #include "Object.h" @@ -46,9 +47,23 @@ void Array::add(Object *elem) { } Object *Array::get(int i, Object *obj) { + if (i < 0 || i >= length) { +#ifdef DEBUG_MEM + abort(); +#else + return obj->initNull(); +#endif + } return elems[i].fetch(xref, obj); } Object *Array::getNF(int i, Object *obj) { + if (i < 0 || i >= length) { +#ifdef DEBUG_MEM + abort(); +#else + return obj->initNull(); +#endif + } return elems[i].copy(obj); }