[FFmpeg-devel] [PATCH 03/15] avfilter/vf_xbr: Fix left shift of negative number
Andreas Rheinhardt
andreas.rheinhardt at gmail.com
Wed Sep 25 01:02:58 EEST 2019
Affected every usage of vf_xbr, e.g. the FATE-tests filter-2xbr,
filter-3xbr, filter-4xbr.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
libavfilter/vf_xbr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavfilter/vf_xbr.c b/libavfilter/vf_xbr.c
index 2c71871d22..a854fb0c8c 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 + FFLSHIFT(rg, 16) + 0x010101 * startg;
for (g = startg; g <= endg; g++) {
s->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
c+= 0x010101;
--
2.20.1
More information about the ffmpeg-devel
mailing list