mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-22 14:57:05 +00:00
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>
This commit is contained in:
parent
37d8033fd0
commit
4ee6a9b1bb
@ -523,7 +523,7 @@ static av_cold 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++) {
|
||||||
hqx->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
|
hqx->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v;
|
||||||
c+= 0x010101;
|
c+= 0x010101;
|
||||||
|
Loading…
Reference in New Issue
Block a user