[FFmpeg-cvslog] avcodec/mss4: check return value of init_get_bits8()

Paul B Mahol git at videolan.org
Tue Feb 24 14:18:41 CET 2015


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Feb 24 13:17:34 2015 +0000| [418be7ceb4717e88b2914a542b68c2c5aba5d677] | committer: Paul B Mahol

avcodec/mss4: check return value of init_get_bits8()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

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

diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index 07d90ed..00c31dd 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;



More information about the ffmpeg-cvslog mailing list