[FFmpeg-cvslog] avfilter/vf_v360: fix possible out of range values

Paul B Mahol git at videolan.org
Sun Oct 4 20:25:46 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Oct  4 19:06:58 2020 +0200| [3a035a8cd2ca6875073e59a76f9862dc02ad1d9b] | committer: Paul B Mahol

avfilter/vf_v360: fix possible out of range values

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a035a8cd2ca6875073e59a76f9862dc02ad1d9b
---

 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);
 }
 
 /**



More information about the ffmpeg-cvslog mailing list