[vlc-commits] adpcm: reject invalid QuickTime IMA files

Rafaël Carré git at videolan.org
Thu May 26 18:40:34 CEST 2016


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Wed May 25 10:00:25 2016 +0200| [458ed62bbeb9d1bddf7b8df104e14936408a3db9] | committer: 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 at gmail.com>

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=458ed62bbeb9d1bddf7b8df104e14936408a3db9
---

 modules/codec/adpcm.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/codec/adpcm.c b/modules/codec/adpcm.c
index 41321fe..ce89b2d 100644
--- a/modules/codec/adpcm.c
+++ b/modules/codec/adpcm.c
@@ -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 */



More information about the vlc-commits mailing list