[FFmpeg-cvslog] avcodec/adpcm: Check init_get_bits8() for failure

Michael Niedermayer git at videolan.org
Fri Sep 4 12:05:02 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Sep  4 11:47:38 2015 +0200| [66a7bc0010942a3de9cf538b62245db4a5e74cbb] | committer: Michael Niedermayer

avcodec/adpcm: Check init_get_bits8() for failure

Fixes CID1322317

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66a7bc0010942a3de9cf538b62245db4a5e74cbb
---

 libavcodec/adpcm.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index bcd7392..52d0d44 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -775,7 +775,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
             int samples_per_block = ff_adpcm_ima_block_samples[avctx->bits_per_coded_sample - 2];
             GetBitContext g;
 
-            init_get_bits8(&g, gb.buffer, bytestream2_get_bytes_left(&gb));
+            ret = init_get_bits8(&g, gb.buffer, bytestream2_get_bytes_left(&gb));
+            if (ret < 0)
+                return ret;
             for (n = 0; n < (nb_samples - 1) / samples_per_block; n++) {
                 for (i = 0; i < avctx->channels; i++) {
                     cs = &c->status[i];



More information about the ffmpeg-cvslog mailing list