Browse code

Fix bug when elbg->utility_inc[elbg->numCB-1] == 1

Originally committed as revision 17926 to svn://svn.ffmpeg.org/ffmpeg/trunk

Vitor Sessak authored on 2009/03/11 02:38:16
Showing 1 changed files
... ...
@@ -105,7 +105,7 @@ static int get_high_utility_cell(elbg_data *elbg)
105 105
 {
106 106
     int i=0;
107 107
     /* Using linear search, do binary if it ever turns to be speed critical */
108
-    int r = av_lfg_get(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1;
108
+    int r = av_lfg_get(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1] + 1;
109 109
     while (elbg->utility_inc[i] < r)
110 110
         i++;
111 111