Commit a113b849 authored by Rafaël Carré's avatar 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: default avatarWilliam Blough <blough@shell.cs.fsu.edu>
parent 149394aa
...@@ -118,6 +118,14 @@ reject: ...@@ -118,6 +118,14 @@ reject:
mad_fixed_t const * p_right = p_pcm->samples[1]; mad_fixed_t const * p_right = p_pcm->samples[1];
float *p_samples = (float *)p_out_buf->p_buffer; 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 ) if( i_samples != p_out_buf->i_nb_samples )
{ {
msg_Err( p_filter, "unexpected samples count (corrupt stream?): " msg_Err( p_filter, "unexpected samples count (corrupt stream?): "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment