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

Michael Niedermayer michaelni at gmx.at
Sun Jan 27 22:36:37 CET 2013


This also fixes a potential integer overflow

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/alsdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d7baa6e..9082e81 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -290,7 +290,8 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
     AVCodecContext *avctx    = ctx->avctx;
     uint32_t als_id, header_size, trailer_size;
 
-    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);
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list