History

avfilter/vf_signalstats: fix stack buffer overflow

Fixes #8249

Paul B Mahol committed 7 years ago

Commit 71d9ae11 parent 0e68e8c1 file · +2 −2Browse files

Unified · Split

libavfilter/vf_signalstats.c+2−2
@@ -491,7 +491,7 @@ static int compute_sat_hue_metrics8(AVFilterContext *ctx, void *arg, int jobnr, · 490 unmodified lines
491491 const int yuvu = p_u[i];
492492 const int yuvv = p_v[i];
493493 p_sat[i] = hypot(yuvu - 128, yuvv - 128); // int or round?
494− ((int16_t*)p_hue)[i] = floor((180 / M_PI) * atan2f(yuvu-128, yuvv-128) + 180);
494+ ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-128, yuvv-128) + 180), 360.);
495495 }
496496 p_u += lsz_u;
497497 p_v += lsz_v;
@@ -530,7 +530,7 @@ static int compute_sat_hue_metrics16(AVFilterContext *ctx, void *arg, int jobnr, · 32 unmodified lines
530530 const int yuvu = p_u[i];
531531 const int yuvv = p_v[i];
532532 p_sat[i] = hypot(yuvu - mid, yuvv - mid); // int or round?
533− ((int16_t*)p_hue)[i] = floor((180 / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180);
533+ ((int16_t*)p_hue)[i] = fmod(floor((180 / M_PI) * atan2f(yuvu-mid, yuvv-mid) + 180), 360.);
534534 }
535535 p_u += lsz_u;
536536 p_v += lsz_v;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t