Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/Array.cc
diff options
context:
space:
mode:
Diffstat (limited to 'pdf/xpdf/Array.cc')
-rw-r--r--pdf/xpdf/Array.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/pdf/xpdf/Array.cc b/pdf/xpdf/Array.cc
index 9c6cb34..27ecbe9 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 <stdlib.h>
#include <stddef.h>
#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);
}