ffmpeg | branch: master | Paul B Mahol <[email protected]> | Fri Oct 11 13:32:24 
2019 +0200| [71d9ae11a56df0d8f549295394a4a3af6718cdee] | committer: Paul B Mahol

avfilter/vf_signalstats: fix stack buffer overflow

Fixes #8249

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

 libavfilter/vf_signalstats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index 2b8c0de4c4..abe813d91d 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -491,7 +491,7 @@ static int compute_sat_hue_metrics8(AVFilterContext *ctx, 
void *arg, int jobnr,
             const int yuvu = p_u[i];
             const int yuvv = p_v[i];
             p_sat[i] = hypot(yuvu - 128, yuvv - 128); // int or round?
-            ((int16_t*)p_hue)[i] = floor((180 / M_PI) * atan2f(yuvu-128, 
yuvv-128) + 180);
+            ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-128, 
yuvv-128) + 180), 360.);
         }
         p_u   += lsz_u;
         p_v   += lsz_v;
@@ -530,7 +530,7 @@ static int compute_sat_hue_metrics16(AVFilterContext *ctx, 
void *arg, int jobnr,
             const int yuvu = p_u[i];
             const int yuvv = p_v[i];
             p_sat[i] = hypot(yuvu - mid, yuvv - mid); // int or round?
-            ((int16_t*)p_hue)[i] = floor((180 / M_PI) * atan2f(yuvu-mid, 
yuvv-mid) + 180);
+            ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-mid, 
yuvv-mid) + 180), 360.);
         }
         p_u   += lsz_u;
         p_v   += lsz_v;

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to