[FFmpeg-devel] [PATCH 2/3] avcodec/fastaudio: Remove redundant % 32

Michael Niedermayer michael at niedermayer.cc
Wed Sep 9 00:29:20 EEST 2020


Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/fastaudio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/fastaudio.c b/libavcodec/fastaudio.c
index 34857d1b88..16f44790f5 100644
--- a/libavcodec/fastaudio.c
+++ b/libavcodec/fastaudio.c
@@ -95,7 +95,7 @@ static int read_bits(int bits, int *ppos, unsigned *src)
     r = src[(pos - 1) / 32] >> (32 - pos % 32);
     *ppos = pos;
 
-    return r & ((1 << (bits % 32)) - 1);
+    return r & ((1 << bits) - 1);
 }
 
 static const uint8_t bits[8] = { 6, 6, 5, 5, 4, 0, 3, 3, };
-- 
2.17.1



More information about the ffmpeg-devel mailing list