diff --git a/libavcodec/sheervideo.c b/libavcodec/sheervideo.c index 2f08b7bff0..5b03ce4431 100644 --- a/libavcodec/sheervideo.c +++ b/libavcodec/sheervideo.c @@ -3098,6 +3098,11 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_PATCHWELCOME; } + if (avpkt->size < 20 + avctx->width * avctx->height / 16) { + av_log(avctx, AV_LOG_ERROR, "Input packet too small\n"); + return AVERROR_INVALIDDATA; + } + if (s->format != format) { if (ret < 0) return ret;