Commit 3b63819d authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/vc1: Fix undefined shifts

Found-by: Clang -fsanitize=shift
Reported-by: 's avatarThierry Foucu <tfoucu@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b8535b27
...@@ -572,13 +572,13 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex ...@@ -572,13 +572,13 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
int scale, shift, i; \ int scale, shift, i; \
if (!lumscale) { \ if (!lumscale) { \
scale = -64; \ scale = -64; \
shift = (255 - lumshift * 2) << 6; \ shift = (255 - lumshift * 2) * 64; \
if (lumshift > 31) \ if (lumshift > 31) \
shift += 128 << 6; \ shift += 128 << 6; \
} else { \ } else { \
scale = lumscale + 32; \ scale = lumscale + 32; \
if (lumshift > 31) \ if (lumshift > 31) \
shift = (lumshift - 64) << 6; \ shift = (lumshift - 64) * 64; \
else \ else \
shift = lumshift << 6; \ shift = lumshift << 6; \
} \ } \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment