diff --git a/libavcodec/hdrdec.c b/libavcodec/hdrdec.c index b7ade48e32..cffa7570db 100644 --- a/libavcodec/hdrdec.c +++ b/libavcodec/hdrdec.c @@ -126,6 +126,9 @@ static int hdr_decode_frame(AVCodecContext *avctx, AVFrame *p, ; } + if (bytestream2_get_bytes_left(&gb) < height * 4) + return AVERROR_INVALIDDATA; + if ((ret = ff_set_dimensions(avctx, width, height)) < 0) return ret;