From 3a035a8cd2ca6875073e59a76f9862dc02ad1d9b Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 4 Oct 2020 19:06:58 +0200 Subject: [PATCH] avfilter/vf_v360: fix possible out of range values --- libavfilter/vf_v360.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_v360.c b/libavfilter/vf_v360.c index 853a26da03..2a51f24c34 100644 --- a/libavfilter/vf_v360.c +++ b/libavfilter/vf_v360.c @@ -763,12 +763,12 @@ static inline int mod(int a, int b) static inline int reflecty(int y, int h) { if (y < 0) { - return -y; + y = -y; } else if (y >= h) { - return 2 * h - 1 - y; + y = 2 * h - 1 - y; } - return y; + return av_clip(y, 0, h - 1); } /**