diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 2cf18869e1..0452086be3 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -285,6 +285,8 @@ static int decode_frame(AVCodecContext *avctx, avpriv_request_sample(avctx, "Pack type %d", pack_type); return AVERROR_PATCHWELCOME; } + if (bytestream2_get_bytes_left(&gbc) < 30) + return AVERROR_INVALIDDATA; if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret;