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 ff2073346206195180f0a488d05f8aa8e5d56e57
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Thu Jan 15 02:47:06 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Mon May 4 17:13:14 2026 +0200

    avcodec/exr: use av_realloc_array()
    
    Related to: #YWH-PGM40646-33
    See: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21347
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit 09ec2b397a16de1a8016c33cdb84301b3f5e48e4)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/exr.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 211bc7284d..bb90198a9f 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1779,12 +1779,17 @@ static int decode_header(EXRContext *s, AVFrame *frame)
                     }
                 }
 
-                s->channels = av_realloc(s->channels,
-                                         ++s->nb_channels * 
sizeof(EXRChannel));
-                if (!s->channels) {
+                av_assert0(s->nb_channels < INT_MAX); // Impossible due to 
size of the bitstream
+                EXRChannel *new_channels = av_realloc_array(s->channels,
+                                                            s->nb_channels + 1,
+                                                            
sizeof(EXRChannel));
+                if (!new_channels) {
                     ret = AVERROR(ENOMEM);
                     goto fail;
                 }
+                s->nb_channels ++;
+                s->channels = new_channels;
+
                 channel             = &s->channels[s->nb_channels - 1];
                 channel->pixel_type = current_pixel_type;
                 channel->xsub       = xsub;

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

Reply via email to