[vlc-commits] mpgatofixed32: check for invalid channels count
Rafaël Carré
git at videolan.org
Sat Apr 19 10:31:14 CEST 2014
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sat Apr 19 10:28:56 2014 +0200| [a113b849e428b71813a569021bd10d6974f6621f] | committer: Rafaël Carré
mpgatofixed32: check for invalid channels count
Make sure the buffer was allocated with enough channels.
This should not happen anymore since transcode now restarts
filter chain on format changes.
Reported-by: William Blough <blough at shell.cs.fsu.edu>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a113b849e428b71813a569021bd10d6974f6621f
---
modules/audio_filter/converter/mpgatofixed32.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/modules/audio_filter/converter/mpgatofixed32.c b/modules/audio_filter/converter/mpgatofixed32.c
index b517952..15a8ff7 100644
--- a/modules/audio_filter/converter/mpgatofixed32.c
+++ b/modules/audio_filter/converter/mpgatofixed32.c
@@ -118,6 +118,14 @@ reject:
mad_fixed_t const * p_right = p_pcm->samples[1];
float *p_samples = (float *)p_out_buf->p_buffer;
+ if (p_pcm->channels > p_filter->fmt_out.audio.i_channels)
+ {
+ msg_Err( p_filter, "wrong channels count (corrupt stream?): %u > %u",
+ p_pcm->channels, p_filter->fmt_out.audio.i_channels);
+ p_sys->i_reject_count = 3;
+ goto reject;
+ }
+
if( i_samples != p_out_buf->i_nb_samples )
{
msg_Err( p_filter, "unexpected samples count (corrupt stream?): "
More information about the vlc-commits
mailing list