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

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

commit 6c1c0470e8e60ff8d16b97a2822b9bb2338f1abf
Author:     Andreas Rheinhardt <[email protected]>
AuthorDate: Wed May 22 06:57:19 2024 +0200
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Sat Jun 20 17:42:28 2026 +0200

    avformat/dhav: Check amount read
    
    Prevents potential use of uninitialized data in the following
    memcmp().
    
    Signed-off-by: Andreas Rheinhardt <[email protected]>
    (cherry picked from commit d8cad01805be74783344d69e81c9c31f49ba4d92)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/dhav.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index 62e9bd5c5b..c20d435704 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -271,9 +271,12 @@ static int dhav_read_header(AVFormatContext *s)
 {
     DHAVContext *dhav = s->priv_data;
     uint8_t signature[5];
+    int ret;
 
     ffio_ensure_seekback(s->pb, 5);
-    avio_read(s->pb, signature, sizeof(signature));
+    ret = ffio_read_size(s->pb, signature, sizeof(signature));
+    if (ret < 0)
+        return ret;
     if (!memcmp(signature, "DAHUA", 5)) {
         avio_skip(s->pb, 0x400 - 5);
         dhav->last_good_pos = avio_tell(s->pb);

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

Reply via email to