[FFmpeg-cvslog] avutil/tx: avoid negative left shifts

Michael Niedermayer git at videolan.org
Fri Jun 18 20:13:39 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue May  4 18:22:40 2021 +0200| [85b883429fb1a8c1be2e39fee510315a92b6cd02] | committer: Michael Niedermayer

avutil/tx: avoid negative left shifts

Fixes: left shift of negative value -1
Fixes: 33736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-6657785795313664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=85b883429fb1a8c1be2e39fee510315a92b6cd02
---

 libavutil/tx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/tx.c b/libavutil/tx.c
index 8da04e99ca..25adb6b37e 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -97,9 +97,9 @@ static inline int split_radix_permutation(int i, int m, int inverse)
     if (m <= 1)
         return i & 1;
     if (!(i & m))
-        return (split_radix_permutation(i, m, inverse) << 1);
+        return split_radix_permutation(i, m, inverse) * 2;
     m >>= 1;
-    return (split_radix_permutation(i, m, inverse) << 2) + 1 - 2*(!(i & m) ^ inverse);
+    return split_radix_permutation(i, m, inverse) * 4 + 1 - 2*(!(i & m) ^ inverse);
 }
 
 int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup)



More information about the ffmpeg-cvslog mailing list