[vlc-commits] mpgatofixed32: check for invalid channels count
Rafaël Carré
git at videolan.org
Sat Apr 19 10:32:08 CEST 2014
vlc/vlc-2.1 | branch: master | Rafaël Carré <funman at videolan.org> | Sat Apr 19 10:28:56 2014 +0200| [a5bee4c5cf0c8fca0d1ddaf570aeebc78e824b15] | 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>
(cherry picked from commit a113b849e428b71813a569021bd10d6974f6621f)
Signed-off-by: Rafaël Carré <funman at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=a5bee4c5cf0c8fca0d1ddaf570aeebc78e824b15
---
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 0121b94..333d9d8 100644
--- a/modules/audio_filter/converter/mpgatofixed32.c
+++ b/modules/audio_filter/converter/mpgatofixed32.c
@@ -122,6 +122,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