This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 3cdbbdaaa8 avcodec/4xm: fix unaligned access
3cdbbdaaa8 is described below
commit 3cdbbdaaa8205b2c25fecf3a2eb168757e050535
Author: Marvin Scholz <[email protected]>
AuthorDate: Thu Oct 29 22:33:46 2026 +0000
Commit: Marvin Scholz <[email protected]>
CommitDate: Tue Nov 10 22:26:48 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]>
---
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]