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

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

commit 1b5cd3a792c051b40dbe94e0229489354bb09b59
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Fri Mar 20 23:38:14 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Tue May 5 18:55:09 2026 +0200

    avcodec/dvdsub_parser: Fix buf_size check
    
    Fixes: signed integer overflow
    Fixes: out of array access
    Fixes: dvdsub_int_overflow_mixed_ps.mpg
    
    Found-by: Quang Luong of Calif.io in collaboration with OpenAI Codex
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit 1bde76da890127608744c3b17669a99d2adce54a)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/dvdsub_parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dvdsub_parser.c b/libavcodec/dvdsub_parser.c
index 054af69db9..ad9a6ffb32 100644
--- a/libavcodec/dvdsub_parser.c
+++ b/libavcodec/dvdsub_parser.c
@@ -59,7 +59,7 @@ static int dvdsub_parse(AVCodecParserContext *s,
         pc->packet = av_malloc(pc->packet_len + AV_INPUT_BUFFER_PADDING_SIZE);
     }
     if (pc->packet) {
-        if (pc->packet_index + buf_size <= pc->packet_len) {
+        if (buf_size <= pc->packet_len - pc->packet_index) {
             memcpy(pc->packet + pc->packet_index, buf, buf_size);
             pc->packet_index += buf_size;
             if (pc->packet_index >= pc->packet_len) {

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to