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

Git pushed a commit to branch master
in repository ffmpeg.

commit c4a4d5f72a7d89de23043415a0a45090c51c502a
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Oct 16 22:21:59 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Mon Oct 19 19:51:43 2026 +0000

    avcodec/xsubenc: reject subtitles without rectangles
    
    Fixes: null pointer dereference
    Fixes: L22GwbO9rtWF
    Fixes: AISLE-2026-0150-00413
    Null pointer dereference Replicated through API with ASAN
    
    Found-by: Joshua Rogers <[email protected]>
    Rejecting the subtitle with AVERROR(EINVAL) was suggested in the report.
---
 libavcodec/xsubenc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c
index 6f417c5958..9e43213ac2 100644
--- a/libavcodec/xsubenc.c
+++ b/libavcodec/xsubenc.c
@@ -128,8 +128,13 @@ static int xsub_encode(AVCodecContext *avctx, unsigned 
char *buf,
         return AVERROR_BUFFER_TOO_SMALL;
     }
 
+    if (!h->num_rects) {
+        av_log(avctx, AV_LOG_ERROR, "No subtitle rectangle to encode.\n");
+        return AVERROR(EINVAL);
+    }
+
     // TODO: support multiple rects
-    if (h->num_rects != 1)
+    if (h->num_rects > 1)
         av_log(avctx, AV_LOG_WARNING, "Only single rects supported (%d in 
subtitle.)\n", h->num_rects);
 
     // TODO: render text-based subtitles into bitmaps

-- 
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