From 7df5cf2f6602f2f13ba492f104969d4a9d01749f Mon Sep 17 00:00:00 2001 From: Sigmund Augdal Helberg Date: Fri, 15 Apr 2005 22:28:24 +0000 Subject: [PATCH] playlist/item-ext.c: fixed off-by-one error causing a crash in ItemGetById --- src/playlist/item-ext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/playlist/item-ext.c b/src/playlist/item-ext.c index 880e659c46..af654ea793 100644 --- a/src/playlist/item-ext.c +++ b/src/playlist/item-ext.c @@ -441,7 +441,7 @@ playlist_item_t *playlist_LockItemGetByPos( playlist_t *p_playlist, int i_pos ) playlist_item_t * playlist_ItemGetById( playlist_t * p_playlist , int i_id ) { int i, i_top, i_bottom; - i_bottom = 0; i_top = p_playlist->i_all_size; + i_bottom = 0; i_top = p_playlist->i_all_size - 1; i = i_top / 2; while( p_playlist->pp_all_items[i]->input.i_id != i_id && i_top > i_bottom ) -- 2.39.5