vorbis: really fix out-of-bound read
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 24 Apr 2014 17:59:46 +0000 (20:59 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 24 Apr 2014 18:00:12 +0000 (21:00 +0300)
Also fix format string.

modules/codec/vorbis.c

index 4d0b57c..4550563 100644 (file)
@@ -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;