This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.0
in repository ffmpeg.

commit 1a703785c7e3b7986a4c3e6a7f98c96caaef6baa
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Sep 14 03:38:39 2026 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Sep 17 02:27:38 2026 +0200

    avcodec/cfhd: reject header tags after the frame buffer was allocated
    
    Found during triage of the security report
    
    Fixes: NULL pointer dereference
    Fixes: 5cNIJSj1u1Lc/input-format-after-header.bin / 
gen-format-after-header.py
    Fixes: 5cNIJSj1u1Lc
    (cherry picked from commit 400912007a36465d6eed2f6b7e867a1fe0ad9016)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/cfhd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index 833ef67948..e91788d4a8 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -633,6 +633,12 @@ static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic,
             goto end;
         }
 
+        if (got_buffer && (s->coded_width || s->coded_height || 
s->coded_format != AV_PIX_FMT_NONE)) {
+            av_log(avctx, AV_LOG_ERROR, "Header tag after end of header\n");
+            ret = AVERROR(EINVAL);
+            goto end;
+        }
+
         if (tag == BitstreamMarker && data == CoefficientSegment &&
             s->coded_format != AV_PIX_FMT_NONE) {
             int lowpass_height = s->plane[s->channel_num].band[0][0].height;
@@ -920,8 +926,7 @@ finish:
     ff_thread_finish_setup(avctx);
 
     if (!s->a_width || !s->a_height || s->a_format == AV_PIX_FMT_NONE ||
-        s->a_transform_type == INT_MIN ||
-        s->coded_width || s->coded_height || s->coded_format != 
AV_PIX_FMT_NONE) {
+        s->a_transform_type == INT_MIN) {
         av_log(avctx, AV_LOG_ERROR, "Invalid dimensions\n");
         ret = AVERROR(EINVAL);
         goto end;

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to