From 94f1f6025c65867742e2fe52d7a07fe3f6b99faa Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 7 Sep 2004 10:45:22 +0000 Subject: [PATCH] Added a size check on heap_array::Adjust(size_t i) to prevent access errors. --- src/osgUtil/TriStrip_heap_array.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osgUtil/TriStrip_heap_array.h b/src/osgUtil/TriStrip_heap_array.h index 22f5c3fc7..78f8e5e92 100644 --- a/src/osgUtil/TriStrip_heap_array.h +++ b/src/osgUtil/TriStrip_heap_array.h @@ -234,7 +234,10 @@ inline void heap_array::update(size_t i, const T & Elem) { template -inline void heap_array::Adjust(size_t i) { +inline void heap_array::Adjust(size_t i) +{ + if (m_Heap.size()<=1) return; // nothing to swap, so just return. + size_t j; // Check the upper part of the heap