aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-28 04:25:56 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-02 10:43:53 +0200
commit0e877c8fdbc7280efb0237dfa588b8205791dc96 (patch)
treebdeb4da253d4180f6dd62eecf4d8ac344d734032
parent9be1411c1c08acced03e762a7e673d66877a786d (diff)
downloadffmpeg-0e877c8fdbc7280efb0237dfa588b8205791dc96.tar.gz
avfilter/vf_xbr: Fix left shift of negative number
Affected every usage of vf_xbr, e.g. the FATE-tests filter-2xbr, filter-3xbr, filter-4xbr. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4294dc3589a3ab973b10a85b576ff15e3ffb000d) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavfilter/vf_xbr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c
index 78094e0287..5a6dcc4dba 100644
--- a/libavfilter/vf_xbr.c
+++ b/libavfilter/vf_xbr.c
@@ -395,7 +395,7 @@ static int init(AVFilterContext *ctx)
int startg = FFMAX3(-bg, -rg, 0);
int endg = FFMIN3(255-bg, 255-rg, 255);
uint32_t y = (uint32_t)(( 299*rg + 1000*startg + 114*bg)/1000);
- c = bg + (rg<<16) + 0x010101 * startg;
+ c = bg + rg * (1 << 16) + 0x010101 * startg;
for (g = startg; g <= endg; g++) {
s->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
c+= 0x010101;