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 f1acb0a266 avcodec/4xm: fix unaligned access
f1acb0a266 is described below

commit f1acb0a2666c78d92688f4c3d2803a132f5590f6
Author:     Marvin Scholz <[email protected]>
AuthorDate: Thu Oct 29 22:33:46 2026 +0000
Commit:     ffmpeg-devel <[email protected]>
CommitDate: Tue Nov 10 22:27:49 2026 +0000

    avcodec/4xm: fix unaligned access
    
    Using bswap_buf on unaligned bitstream chunk from packet directly is
    undefined behavior. Copy to bitstream_buffer first which is fully
    aligned.
    
    Signed-off-by: Marvin Scholz <[email protected]>
    (cherry picked from commit 3cdbbdaaa8205b2c25fecf3a2eb168757e050535)
---
 libavcodec/4xm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index c6b2ce1230..78bc390809 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -469,7 +469,8 @@ static int decode_p_frame(FourXContext *f, const uint8_t 
*buf, int length)
                           bitstream_size);
     if (!f->bitstream_buffer)
         return AVERROR(ENOMEM);
-    f->bbdsp.bswap_buf(f->bitstream_buffer, (const uint32_t *) (buf + extra),
+    memcpy(f->bitstream_buffer, buf + extra, bitstream_size);
+    f->bbdsp.bswap_buf(f->bitstream_buffer, f->bitstream_buffer,
                        bitstream_size / 4);
     init_get_bits(&f->gb, f->bitstream_buffer, 8 * bitstream_size);
 
@@ -813,7 +814,8 @@ static int decode_i_frame(FourXContext *f, const uint8_t 
*buf, int length)
                           prestream_size);
     if (!f->bitstream_buffer)
         return AVERROR(ENOMEM);
-    f->bbdsp.bswap_buf(f->bitstream_buffer, (const uint32_t *) prestream,
+    memcpy(f->bitstream_buffer, prestream, prestream_size);
+    f->bbdsp.bswap_buf(f->bitstream_buffer, f->bitstream_buffer,
                        prestream_size / 4);
     init_get_bits(&f->pre_gb, f->bitstream_buffer, 8 * prestream_size);
 

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