From 418be7ceb4717e88b2914a542b68c2c5aba5d677 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 24 Feb 2015 13:17:34 +0000 Subject: [PATCH] avcodec/mss4: check return value of init_get_bits8() Signed-off-by: Paul B Mahol --- libavcodec/mss4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index 07d90ed4f3..00c31dda15 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -572,7 +572,8 @@ static int mss4_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, ff_mss34_gen_quant_mat(c->quant_mat[i], quality, !i); } - init_get_bits8(&gb, buf + HEADER_SIZE, (buf_size - HEADER_SIZE)); + if ((ret = init_get_bits8(&gb, buf + HEADER_SIZE, buf_size - HEADER_SIZE)) < 0) + return ret; mb_width = FFALIGN(width, 16) >> 4; mb_height = FFALIGN(height, 16) >> 4;