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

Git pushed a commit to branch master
in repository ffmpeg.

commit 0911c6ca911b1e64cd803765dc72fe113b116cf0
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Nov 11 18:36:54 2026 +0100
Commit:     michaelni <[email protected]>
CommitDate: Sun Nov 15 20:27:15 2026 +0000

    avcodec/exr: count the DWA channel rules in the compressed size check
    
    Fixes: out of array read
    Fixes: EqK8nzVwkNsr
    Fixes: exr-dwa-skip-rle.exr
    Fixes: exr-dwa-skip-ac.exr
    Out of array read Replicated through UnModified FFmpeg with ASAN
    
    Found-by: Martin Mirchev, with an LLM-enhanced static analysis engine; 
verified manually by Martin Mirchev
---
 libavcodec/exr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index d53bd9ba40..a61ba3b593 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1021,7 +1021,7 @@ static int dwa_uncompress(const EXRContext *s, const 
uint8_t *src, int compresse
     dc_count = AV_RL64(src + 72);
     ac_compression = AV_RL64(src + 80);
 
-    if (   compressed_size < (uint64_t)(lo_size | ac_size | dc_size | 
rle_csize) || compressed_size < 88LL + lo_size + ac_size + dc_size + rle_csize
+    if (   compressed_size < (uint64_t)(lo_size | ac_size | dc_size | 
rle_csize)
         || ac_count > (uint64_t)INT_MAX/2
     )
         return AVERROR_INVALIDDATA;
@@ -1042,7 +1042,7 @@ static int dwa_uncompress(const EXRContext *s, const 
uint8_t *src, int compresse
 
     bytestream2_init(&gb, src + 88, compressed_size - 88);
     skip = bytestream2_get_le16(&gb);
-    if (skip < 2)
+    if (skip < 2 || compressed_size < 88LL + skip + lo_size + ac_size + 
dc_size + rle_csize)
         return AVERROR_INVALIDDATA;
 
     bytestream2_skip(&gb, skip - 2);

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