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

Git pushed a commit to branch master
in repository ffmpeg.

commit 3afa5444a38cfd5ec04c2e133da710b95b952f21
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Sat Sep 5 23:27:34 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Wed Sep 16 20:48:11 2026 +0000

    avformat/mov: do not zero a key string before reading it
    
    Fixes: OOM
    Fixes: poc-keys-bigkey-256M.mp4
    Fixes: hKO4f7GYoUd0
---
 libavformat/mov.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9e68882d61..6abd3f3513 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5757,10 +5757,13 @@ static int mov_read_keys(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
             avio_skip(pb, key_size);
             continue;
         }
-        c->meta_keys[i] = av_mallocz(key_size + 1);
+        c->meta_keys[i] = av_malloc(key_size + 1);
         if (!c->meta_keys[i])
             return AVERROR(ENOMEM);
-        avio_read(pb, c->meta_keys[i], key_size);
+        int ret = ffio_read_size(pb, c->meta_keys[i], key_size);
+        if (ret < 0)
+            return ret;
+        c->meta_keys[i][key_size] = 0;
     }
 
     return 0;

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