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:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-09-28 05:25:57 +0300
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-03 15:13:50 +0300
commit0b4a122a5ab8a5013cb7980cb6104a17e5e51100 (patch)
tree143829767b65f968757aaf58d8edb45d5a32693b
parentd4f2de5151d44028f5122b2051c532f26473e2ce (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 <andreas.rheinhardt@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit fa211943265ca991548a4cc2f85a6df9cedcd092) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-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 5f63b2a3f9..8899d7a70f 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;