diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-21 22:52:19 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-19 17:17:35 +0200 |
commit | ea7a818c9529b24ff39baadae5658fc91b8354fc (patch) | |
tree | b2b49a738dee5aa2d59758eb7a6aa9528cf9154c | |
parent | 8a9c9711cf0d0bd7b0335ce2a5160c3d3eb9b5a4 (diff) | |
download | ffmpeg-ea7a818c9529b24ff39baadae5658fc91b8354fc.tar.gz |
swscale/output: Fix several invalid shifts in yuv2rgb_full_1_c_template()
Fixes: Invalid shifts
Fixes: #8320
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b7f97532b2ac8836d8d8e3c71dd026e35ae1ca7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libswscale/output.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libswscale/output.c b/libswscale/output.c index 26b0ff3d48..74d420e613 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -2090,7 +2090,7 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0, if (uvalpha < 2048) { int A = 0; //init to silence warning for (i = 0; i < dstW; i++) { - int Y = buf0[i] << 2; + int Y = buf0[i] * 4; int U = (ubuf0[i] - (128<<7)) * 4; int V = (vbuf0[i] - (128<<7)) * 4; @@ -2107,9 +2107,9 @@ yuv2rgb_full_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; int A = 0; //init to silence warning for (i = 0; i < dstW; i++) { - int Y = buf0[i] << 2; - int U = (ubuf0[i] + ubuf1[i] - (128<<8)) << 1; - int V = (vbuf0[i] + vbuf1[i] - (128<<8)) << 1; + int Y = buf0[i] * 4; + int U = (ubuf0[i] + ubuf1[i] - (128<<8)) * 2; + int V = (vbuf0[i] + vbuf1[i] - (128<<8)) * 2; if (hasAlpha) { A = (abuf0[i] + 64) >> 7; |