summaryrefslogtreecommitdiff
path: root/libavfilter/vf_v360.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-10-04 19:06:58 +0200
committerPaul B Mahol <onemda@gmail.com>2020-10-04 19:23:52 +0200
commit3a035a8cd2ca6875073e59a76f9862dc02ad1d9b (patch)
tree6fda60a039ec2bc538c1223f15bcde7914723162 /libavfilter/vf_v360.c
parenteaba6cecfb5e83ad7b37da5eda236aa5fc6f5f4c (diff)
avfilter/vf_v360: fix possible out of range values
Diffstat (limited to 'libavfilter/vf_v360.c')
-rw-r--r--libavfilter/vf_v360.c6
1 files 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);
}
/**