Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-01-22 00:52:19 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-02 20:55:09 +0300
commit65d9d164da20ac95d54d35f558e1e101c1f8a6a9 (patch)
tree3b79436b173282e56821c94925dbd2af96cd8351 /libswscale
parent850eec92d0e594ae8839e76c2aaac90e2e3856da (diff)
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>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/output.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index f30bce8dd3..c1d07b427d 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1877,7 +1877,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;
@@ -1894,9 +1894,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;