[libgee] PriorityQueue: Fix underflow while updating degree, fixes bug #647162



commit d60c762cb4bdd91d7f5ce3a2b625fae2a1fbbf2b
Author: Hisao Suzuki <suzuki611 oki com>
Date:   Thu Sep 29 13:01:17 2011 +0200

    PriorityQueue: Fix underflow while updating degree, fixes bug #647162

 gee/priorityqueue.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gee/priorityqueue.vala b/gee/priorityqueue.vala
index c2275ff..65ca7a2 100644
--- a/gee/priorityqueue.vala
+++ b/gee/priorityqueue.vala
@@ -670,7 +670,7 @@ public class Gee.PriorityQueue<G> : Gee.AbstractQueue<G> {
 				_a[degree] = null;
 
 				int i = _a.length - 1;
-				while (_a[i] == null) {
+				while (a >= 0 && _a[i] == null) {
 					i--;
 				}
 				_a.resize (i + 1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]