Commit f5bc59c5 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

mpeg4audio: Fix a crash with some invalid streams.

If rate stays at 0, a FPE will be raised in SetupOutput.
parent 09c2cc89
...@@ -807,6 +807,9 @@ static int LOASParse( decoder_t *p_dec, uint8_t *p_buffer, int i_buffer ) ...@@ -807,6 +807,9 @@ static int LOASParse( decoder_t *p_dec, uint8_t *p_buffer, int i_buffer )
p_sys->i_rate = st->cfg.i_samplerate; p_sys->i_rate = st->cfg.i_samplerate;
p_sys->i_frame_length = st->cfg.i_frame_length; p_sys->i_frame_length = st->cfg.i_frame_length;
if ( p_sys->i_channels > 0 && p_sys->i_rate > 0 &&
p_sys->i_frame_length > 0 )
{
/* FIXME And if it changes ? */ /* FIXME And if it changes ? */
if( !p_dec->fmt_out.i_extra && st->i_extra > 0 ) if( !p_dec->fmt_out.i_extra && st->i_extra > 0 )
{ {
...@@ -819,10 +822,10 @@ static int LOASParse( decoder_t *p_dec, uint8_t *p_buffer, int i_buffer ) ...@@ -819,10 +822,10 @@ static int LOASParse( decoder_t *p_dec, uint8_t *p_buffer, int i_buffer )
} }
memcpy( p_dec->fmt_out.p_extra, st->extra, st->i_extra ); memcpy( p_dec->fmt_out.p_extra, st->extra, st->i_extra );
} }
p_sys->b_latm_cfg = true; p_sys->b_latm_cfg = true;
} }
} }
}
/* Wait for the configuration */ /* Wait for the configuration */
if( !p_sys->b_latm_cfg ) if( !p_sys->b_latm_cfg )
return 0; return 0;
......
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