Commit 4294dc35 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Michael Niedermayer

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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent fa211943
...@@ -395,7 +395,7 @@ static int init(AVFilterContext *ctx) ...@@ -395,7 +395,7 @@ static int init(AVFilterContext *ctx)
int startg = FFMAX3(-bg, -rg, 0); int startg = FFMAX3(-bg, -rg, 0);
int endg = FFMIN3(255-bg, 255-rg, 255); int endg = FFMIN3(255-bg, 255-rg, 255);
uint32_t y = (uint32_t)(( 299*rg + 1000*startg + 114*bg)/1000); 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++) { for (g = startg; g <= endg; g++) {
s->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v; s->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
c+= 0x010101; c+= 0x010101;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment