Skip to content

Commit 6cf6507

Browse files
authored
Merge pull request #204 from Libvisual/lv-flower-fix-out-of-bounds-access
libvisual-plugins: Fix out-of-bounds access for actor "lv_flower"
2 parents 3a20161 + 6cefd0f commit 6cf6507

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

libvisual-plugins/plugins/actor/flower/actor_flower.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,14 @@ static void lv_flower_render (VisPluginData *plugin, VisVideo *video, VisAudio *
261261
float y;
262262
int i;
263263
for (i=0; i<priv->nof_bands; i++) {
264-
y=temp_bars[i * 8];
264+
y=temp_bars[i];
265265
y=y*(i*lk+l0);
266266

267267
y = ( log(y - x00) * scale + y00 ); /* Logarithmic amplitude */
268268

269269
y = ( (DIF-2.0)*y +
270270
(i==0 ? 0 : temp_bars[i - 1]) +
271-
(i==31 ? 0 : temp_bars[i + 1])) / DIF;
271+
(i==(NOTCH_BANDS - 1) ? 0 : temp_bars[i + 1])) / DIF;
272272

273273
y=((1.0-TAU)*priv->flower.audio_bars[i]+TAU*y) * 1.00;
274274
priv->flower.audio_bars[i]=y;

0 commit comments

Comments
 (0)