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 063684efec avcodec/mlp: Don't use internals of CRC API
063684efec is described below
commit 063684efeccfdd65289bc6de9a27f52f3cb6e125
Author: Andreas Rheinhardt <[email protected]>
AuthorDate: Mon Jan 19 00:26:34 2026 +0100
Commit: Andreas Rheinhardt <[email protected]>
CommitDate: Mon Jan 19 00:30:20 2026 +0100
avcodec/mlp: Don't use internals of CRC API
ff_mlp_restart_checksum() used the (undocumented) layout
of the CRC tables and therefore broke on x86 when the
clmul implementation added in dc03cffe9c9577127ef82b6f56118115f900e5f2
is used. This commit fixes this (and issue #21506).
Signed-off-by: Andreas Rheinhardt <[email protected]>
---
libavcodec/mlp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/mlp.c b/libavcodec/mlp.c
index 33045c08c7..8ea6e6d72e 100644
--- a/libavcodec/mlp.c
+++ b/libavcodec/mlp.c
@@ -107,8 +107,11 @@ uint8_t ff_mlp_restart_checksum(const uint8_t *buf,
unsigned int bit_size)
int i;
int num_bytes = (bit_size + 2) / 8;
- int crc = crc_1D[buf[0] & 0x3f];
- crc = av_crc(crc_1D, crc, buf + 1, num_bytes - 2);
+ // The two most significant bits of buf[0] are not supposed
+ // to be contained in the checksum; using buf[0] & 0xC0 as start value
+ // achieves this.
+ int crc = av_crc(crc_1D, buf[0] & 0xC0, buf, num_bytes - 1);
+
crc ^= buf[num_bytes - 1];
for (i = 0; i < ((bit_size + 2) & 7); i++) {
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]