diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-08-18 23:25:11 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-08-19 01:29:11 +0200 |
commit | 124eec942a02d1c723c71de4baf62965315c84b7 (patch) | |
tree | 1c019963892396a0380e917846267b6aed07322f /libavfilter | |
parent | 4cdab8d022844dddcac3c4c5c849fd207bc73dea (diff) | |
download | ffmpeg-124eec942a02d1c723c71de4baf62965315c84b7.tar.gz |
avfilter/vf_palettegen: fix integer overflow
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_palettegen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_palettegen.c b/libavfilter/vf_palettegen.c index ef8bc181c5..048ef8e994 100644 --- a/libavfilter/vf_palettegen.c +++ b/libavfilter/vf_palettegen.c @@ -113,8 +113,8 @@ static int cmp_##name(const void *pa, const void *pb) \ { \ const struct color_ref * const *a = pa; \ const struct color_ref * const *b = pb; \ - return ((*a)->color >> (8 * (2 - (pos))) & 0xff) \ - - ((*b)->color >> (8 * (2 - (pos))) & 0xff); \ + return (int)((*a)->color >> (8 * (2 - (pos))) & 0xff) \ + - (int)((*b)->color >> (8 * (2 - (pos))) & 0xff); \ } DECLARE_CMP_FUNC(r, 0) |