summaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-25 18:30:00 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-25 18:31:25 +0100
commitbdcd36a4c81c50254f6204e83e0c14adc1391e66 (patch)
tree8990f5a4e050f01348dc325d6c8f82a7345eb142 /libswscale
parent3a6df0b4bb588288fbf0f60081b20022a838ea79 (diff)
downloadffmpeg-streaming-bdcd36a4c81c50254f6204e83e0c14adc1391e66.zip
ffmpeg-streaming-bdcd36a4c81c50254f6204e83e0c14adc1391e66.tar.gz
swscale/output: Fix undefined shifts
Fixes: da14e86d8462be6493eab16bc2d40f88/asan_heap-oob_204cfd2_528_cov_340150052_COMPRESS.BMP Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/output.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index 88fa2b5..6048e2b 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1709,8 +1709,8 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0,
int A = 0; //init to silence warning
for (i = 0; i < dstW; i++) {
int Y = buf0[i] << 2;
- int U = (ubuf0[i] - (128<<7)) << 2;
- int V = (vbuf0[i] - (128<<7)) << 2;
+ int U = (ubuf0[i] - (128<<7)) * 4;
+ int V = (vbuf0[i] - (128<<7)) * 4;
if (hasAlpha) {
A = (abuf0[i] + 64) >> 7;
OpenPOWER on IntegriCloud