ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Wed Apr  9 22:04:46 2025 +0200| [c39e23cc919b7154d7ffec4e5959cdeba79c0bb5] | 
committer: Andreas Rheinhardt

avcodec/hq_hqa: Check available date before allocating frame

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c39e23cc919b7154d7ffec4e5959cdeba79c0bb5
---

 libavcodec/hq_hqa.c | 3 +++
 1 file changed, 3 insertions(+)

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;

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to