[vlc-commits] codec: adpcm: check min samples prior read

Francois Cartegnie git at videolan.org
Thu Sep 29 11:44:49 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Sep 29 11:35:32 2016 +0200| [4c17d06b91323a175c676e9878b3a263bf66055b] | committer: Francois Cartegnie

codec: adpcm: check min samples prior read

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

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

diff --git a/modules/codec/adpcm.c b/modules/codec/adpcm.c
index 97e26a2..2c4c4be 100644
--- a/modules/codec/adpcm.c
+++ b/modules/codec/adpcm.c
@@ -464,6 +464,8 @@ static void DecodeAdpcmMs( decoder_t *p_dec, int16_t *p_sample,
     int i_block_predictor;
 
     size_t i_total_samples = p_sys->i_samplesperblock;
+    if(i_total_samples < 2)
+        return;
 
     b_stereo = p_dec->fmt_in.audio.i_channels == 2 ? 1 : 0;
 



More information about the vlc-commits mailing list