[FFmpeg-cvslog] alsdec/read_specific_config: check for init_get_bits failure

Michael Niedermayer git at videolan.org
Mon Jan 28 15:54:08 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 27 22:36:37 2013 +0100| [4484c722f68e6a54b8bd701d391897bc092b4404] | committer: Michael Niedermayer

alsdec/read_specific_config: check for init_get_bits failure

This also fixes a potential integer overflow

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d7baa6e..524be22 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -289,8 +289,10 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
     ALSSpecificConfig *sconf = &ctx->sconf;
     AVCodecContext *avctx    = ctx->avctx;
     uint32_t als_id, header_size, trailer_size;
+    int ret;
 
-    init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8);
+    if ((ret = init_get_bits8(&gb, avctx->extradata, avctx->extradata_size)) < 0)
+        return ret;
 
     config_offset = avpriv_mpeg4audio_get_config(&m4ac, avctx->extradata,
                                                  avctx->extradata_size * 8, 1);



More information about the ffmpeg-cvslog mailing list