aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/hq_hqa.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-04-09 22:04:46 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2025-04-13 08:26:37 +0200
commitc39e23cc919b7154d7ffec4e5959cdeba79c0bb5 (patch)
treeef05842bbe944ae0ebba536196fbb7742cc86fd7 /libavcodec/hq_hqa.c
parentc1f124f3f03c4a3fe1252e77938172d85151bf3e (diff)
downloadffmpeg-c39e23cc919b7154d7ffec4e5959cdeba79c0bb5.tar.gz
avcodec/hq_hqa: Check available date before allocating frame
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/hq_hqa.c')
-rw-r--r--libavcodec/hq_hqa.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index c849b52073..0baec67136 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -149,6 +149,9 @@ static int hq_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc,
av_log(ctx->avctx, AV_LOG_VERBOSE, "HQ Profile %d\n", prof_num);
}
+ if (bytestream2_get_bytes_left(gbc) < 3 * (profile->num_slices + 1))
+ return AVERROR_INVALIDDATA;
+
ctx->avctx->coded_width = FFALIGN(profile->width, 16);
ctx->avctx->coded_height = FFALIGN(profile->height, 16);
ctx->avctx->width = profile->width;