From: joncruz Date: Sat, 1 Mar 2008 09:03:29 +0000 (+0000) Subject: Fix to check for out of bounds index *before* using the array index X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c4b0ee0ea7b5eabcfcebd721410931afc6de38b6;p=inkscape.git Fix to check for out of bounds index *before* using the array index --- diff --git a/src/display/nr-filter-slot.cpp b/src/display/nr-filter-slot.cpp index 76beb12f5..1501afcbe 100644 --- a/src/display/nr-filter-slot.cpp +++ b/src/display/nr-filter-slot.cpp @@ -308,7 +308,7 @@ int FilterSlot::_get_index(int slot_nr) int seek = _slot_count; do { seek--; - } while (_slot_number[seek] == NR_FILTER_SLOT_NOT_SET && seek >= 0); + } while ((seek >= 0) && (_slot_number[seek] == NR_FILTER_SLOT_NOT_SET)); /* If there is no space for more slots, create more space */ if (seek == _slot_count - 1) { NRPixBlock **new_slot = new NRPixBlock*[_slot_count * 2];