[vlc-commits] aout: fix read overflow

Rémi Denis-Courmont git at videolan.org
Fri Jul 20 16:58:39 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jul 20 17:23:55 2012 +0300| [4a7c50fc2621f20afce6e9bde433b7288ae8df4c] | committer: Rémi Denis-Courmont

aout: fix read overflow

pb_peak and pf_peak have only two elements.
(regression from dcf3f71b3b48090881f8deab305cc31ea1067ca3)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a7c50fc2621f20afce6e9bde433b7288ae8df4c
---

 src/audio_output/volume.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/audio_output/volume.c b/src/audio_output/volume.c
index 791154e..20cbd32 100644
--- a/src/audio_output/volume.c
+++ b/src/audio_output/volume.c
@@ -181,12 +181,12 @@ static float aout_ReplayGainSelect(vlc_object_t *obj, const char *str,
             gain = var_InheritFloat (obj, "audio-replay-gain-default");
 
         multiplier = pow (10., gain / 20.);
-    }
 
-    if (replay_gain->pb_peak[mode]
-     && var_InheritBool (obj, "audio-replay-gain-peak-protection")
-     && replay_gain->pf_peak[mode] * multiplier > 1.0)
-        multiplier = 1.0f / replay_gain->pf_peak[mode];
+        if (replay_gain->pb_peak[mode]
+         && var_InheritBool (obj, "audio-replay-gain-peak-protection")
+         && replay_gain->pf_peak[mode] * multiplier > 1.f)
+            multiplier = 1.f / replay_gain->pf_peak[mode];
+    }
 
     /* Command line / configuration gain */
     multiplier *= var_InheritFloat (obj, "gain");



More information about the vlc-commits mailing list