diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 813eb862c0..6b1faec09e 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -448,6 +448,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, case SMK_BLK_FULL: mode = 0; if(avctx->codec_tag == MKTAG('S', 'M', 'K', '4')) { // In case of Smacker v4 we have three modes + if (get_bits_left(&gb) < 1) + return AVERROR_INVALIDDATA; if(get_bits1(&gb)) mode = 1; else if(get_bits1(&gb)) mode = 2; }