Skip to content

Commit

Permalink
vorbis: really fix out-of-bound read
Browse files Browse the repository at this point in the history
Also fix format string.
  • Loading branch information
Rémi Denis-Courmont committed Apr 24, 2014
1 parent f25e44e commit b54f2c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/codec/vorbis.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ static int ProcessHeaders( decoder_t *p_dec )
p_dec->fmt_out.audio.i_rate = p_sys->vi.rate;
p_dec->fmt_out.audio.i_channels = p_sys->vi.channels;

if( p_dec->fmt_out.audio.i_channels > ARRAY_SIZE(pi_channels_maps) )
if( p_dec->fmt_out.audio.i_channels >= ARRAY_SIZE(pi_channels_maps) )
{
msg_Err( p_dec, "invalid number of channels (not between 1 and %lu): %i",
msg_Err( p_dec, "invalid number of channels (1-%zu): %i",
ARRAY_SIZE(pi_channels_maps),
p_dec->fmt_out.audio.i_channels );
return VLC_EGENERIC;
Expand Down

0 comments on commit b54f2c6

Please sign in to comment.