Commit 4484c722 authored by Michael Niedermayer's avatar Michael Niedermayer

alsdec/read_specific_config: check for init_get_bits failure

This also fixes a potential integer overflow
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Reviewed-by: 's avatarThilo Borgmann <thilo.borgmann@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1146bbc5
...@@ -289,8 +289,10 @@ static av_cold int read_specific_config(ALSDecContext *ctx) ...@@ -289,8 +289,10 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
ALSSpecificConfig *sconf = &ctx->sconf; ALSSpecificConfig *sconf = &ctx->sconf;
AVCodecContext *avctx = ctx->avctx; AVCodecContext *avctx = ctx->avctx;
uint32_t als_id, header_size, trailer_size; 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, config_offset = avpriv_mpeg4audio_get_config(&m4ac, avctx->extradata,
avctx->extradata_size * 8, 1); avctx->extradata_size * 8, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment