summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2019-09-28 04:25:57 +0200
committerAndreas Rheinhardt <[email protected]>2020-07-03 00:03:45 +0200
commit9eeef68b50c22b5b4c64a62cca21caa852282895 (patch)
tree5d8dfaad8934d2a92836c250b18e2001b680ba18
parent5367c91e021d5c790f41a8f071d60806bd1007f3 (diff)
avfilter/vf_hqx: Fix undefined left shifts of negative numbers
Affected every usage of this filter; in particular, it affected the FATE-tests filter-2xbr, filter-3xbr and filter-4xbr. Signed-off-by: Andreas Rheinhardt <[email protected]> Reviewed-by: Paul B Mahol <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit fa211943265ca991548a4cc2f85a6df9cedcd092) Signed-off-by: Andreas Rheinhardt <[email protected]>
-rw-r--r--libavfilter/vf_hqx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_hqx.c b/libavfilter/vf_hqx.c
index 16a1be7bd4..4f768c7a13 100644
--- a/libavfilter/vf_hqx.c
+++ b/libavfilter/vf_hqx.c
@@ -523,7 +523,7 @@ static av_cold 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++) {
hqx->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
c+= 0x010101;