PR #22635 opened by Priyanshuthapliyal
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22635
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22635.patch

Fixes the zero truncated-integer path in read_diff_float_data().

When `ctx->raw_samples[c][i] == 0`, the coded floating-point value should be 
used directly for output. The current code instead masks `raw_mantissa[c][i] 
with 0x007fffffUL`, which discards the sign and exponent bits and preserves 
only the mantissa.

Store the full 32-bit coded float in this path so the original IEEE-754 value 
is preserved.

Signed-off-by: Priyanshu Thapliyal <[email protected]>


>From 717ff6d5dc173199c3fb5f56e413408d8ec225e6 Mon Sep 17 00:00:00 2001
From: Priyanshu Thapliyal <[email protected]>
Date: Fri, 27 Mar 2026 14:22:45 +0530
Subject: [PATCH] avcodec/alsdec: preserve full float value in zero-truncated
 samples

Signed-off-by: Priyanshu Thapliyal <[email protected]>
---
 libavcodec/alsdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 242080a96d..d12f39d714 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1638,7 +1638,7 @@ static int read_diff_float_data(ALSDecContext *ctx, 
unsigned int ra_frame) {
                 tmp_32 = (sign << 31) | ((e + EXP_BIAS) << 23) | (mantissa);
                 ctx->raw_samples[c][i] = tmp_32;
             } else {
-                ctx->raw_samples[c][i] = raw_mantissa[c][i] & 0x007fffffUL;
+                ctx->raw_samples[c][i] = raw_mantissa[c][i];
             }
         }
         align_get_bits(gb);
-- 
2.52.0

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

Reply via email to