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:
authorPaul B Mahol <onemda@gmail.com>2021-08-19 00:25:11 +0300
committerPaul B Mahol <onemda@gmail.com>2021-08-19 02:29:11 +0300
commit124eec942a02d1c723c71de4baf62965315c84b7 (patch)
tree1c019963892396a0380e917846267b6aed07322f
parent4cdab8d022844dddcac3c4c5c849fd207bc73dea (diff)
avfilter/vf_palettegen: fix integer overflow
-rw-r--r--libavfilter/vf_palettegen.c4
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)