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

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

The following commit(s) were added to refs/heads/release/8.1 by this push:
     new 0a8bf5fcaa avcodec/bsf/extract_extradata: don't use a NULL pointer to 
initialize an empty PutByteContext
0a8bf5fcaa is described below

commit 0a8bf5fcaae2bd9568901e86a656e10733b843a3
Author:     James Almer <[email protected]>
AuthorDate: Fri Mar 13 20:15:24 2026 -0300
Commit:     James Almer <[email protected]>
CommitDate: Sun Mar 15 19:44:21 2026 -0300

    avcodec/bsf/extract_extradata: don't use a NULL pointer to initialize an 
empty PutByteContext
    
    Fixes UB in the form or adding a 0 offset to a NULL pointer, and 
substracting a
    NULL pointer from another.
    
    Signed-off-by: James Almer <[email protected]>
---
 libavcodec/bsf/extract_extradata.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/bsf/extract_extradata.c 
b/libavcodec/bsf/extract_extradata.c
index 1532eb6a7d..6a9a43b0db 100644
--- a/libavcodec/bsf/extract_extradata.c
+++ b/libavcodec/bsf/extract_extradata.c
@@ -369,8 +369,9 @@ static int extract_extradata_lcevc(AVBSFContext *ctx, 
AVPacket *pkt,
     for (i = 0; i < s->h2645_pkt.nb_nals; i++) {
         H2645NAL *nal = &s->h2645_pkt.nals[i];
         if (val_in_array(extradata_nal_types, nb_extradata_nal_types, 
nal->type)) {
-            bytestream2_init_writer(&pb_extradata, NULL, 0);
-            // dummy pass to find sc, gc or ai
+            // dummy pass to find sc, gc or ai. A dummy pointer is used to 
prevent
+            // UB in PutByteContext. Nothing will be written.
+            bytestream2_init_writer(&pb_extradata, nal->data, 0);
             if (!write_lcevc_nalu(ctx, &pb_extradata, nal, 0))
                 extradata_size += nal->raw_size + 3;
         }

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

Reply via email to