avcodec/fate-idct8x8: Defined behavior: eliminate negative left-shifts.
authorKaterina Barone-Adesi <katerinab@gmail.com>
Mon, 19 May 2014 15:27:52 +0000 (17:27 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 20 May 2014 02:21:06 +0000 (04:21 +0200)
commite50ae60d46181814245f70b61b70394311e10373
tree84197bc05af463440414de72ca6620299e564586
parent7d25af1547f8d97231f1c6e4cab7ad2bbf1dd071
avcodec/fate-idct8x8: Defined behavior: eliminate negative left-shifts.

The original code left-shifts negative values, which is undefined
in the C99 specification (the one used during normal FFmpeg compilation).
This change multiplies by (1 << shift), which is functionally equivalent,
but has defined behavior.
With this change, fate-idct8x8 compiled with --fsanitize=undefined works.

Bug-Id: 686

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The assembly generated by gcc is unchanged by this commit
libavcodec/jfdctint_template.c
libavcodec/jrevdct.c
libavcodec/simple_idct_template.c