]> git.tokkee.org Git - inkscape.git/commitdiff

Code

Fix to check for out of bounds index *before* using the array index
authorjoncruz <joncruz@users.sourceforge.net>
Sat, 1 Mar 2008 09:03:29 +0000 (09:03 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Sat, 1 Mar 2008 09:03:29 +0000 (09:03 +0000)
src/display/nr-filter-slot.cpp

index 76beb12f5065b53a5a2a88f08300779acdce01d0..1501afcbecb91699ac83b4c227033a5adebe11ba 100644 (file)
@@ -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];