Skip to content

Commit

Permalink
avcodec/vc1: Fix undefined shifts
Browse files Browse the repository at this point in the history
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Mar 15, 2015
1 parent b8535b2 commit 3b63819
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavcodec/vc1.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,13 @@ int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContex
int scale, shift, i; \
if (!lumscale) { \
scale = -64; \
shift = (255 - lumshift * 2) << 6; \
shift = (255 - lumshift * 2) * 64; \
if (lumshift > 31) \
shift += 128 << 6; \
} else { \
scale = lumscale + 32; \
if (lumshift > 31) \
shift = (lumshift - 64) << 6; \
shift = (lumshift - 64) * 64; \
else \
shift = lumshift << 6; \
} \
Expand Down

0 comments on commit 3b63819

Please sign in to comment.