Commit 458ed62b authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Baptiste Kempf

adpcm: reject invalid QuickTime IMA files

DecodeAdpcmImaQT() can only decode up to stereo files.
Fix out of bound write.

Reported by: Patrick Coleman <blinken@gmail.com>
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 6bb12484
......@@ -175,6 +175,12 @@ static int OpenDecoder( vlc_object_t *p_this )
switch( p_dec->fmt_in.i_codec )
{
case VLC_FOURCC('i','m','a', '4'): /* IMA ADPCM */
if (p_dec->fmt_in.audio.i_channels > 2) {
free(p_sys);
msg_Err(p_dec, "Invalid number of channels %i",
p_dec->fmt_in.audio.i_channels );
return VLC_EGENERIC;
}
p_sys->codec = ADPCM_IMA_QT;
break;
case VLC_CODEC_ADPCM_IMA_WAV: /* IMA ADPCM */
......
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