diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-06-05 19:54:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-06 13:54:16 +0200 |
commit | 879ac3418eb946a2e7c82777977c29f553549120 (patch) | |
tree | 35687b6f63a79a177fe61521c39638e76f0c7ac0 /libavfilter | |
parent | 516632359d5998234f9435f00c21ab5aede52067 (diff) | |
download | ffmpeg-879ac3418eb946a2e7c82777977c29f553549120.tar.gz |
avfilter/vf_ciescope: Fix undefined behavior in rgb_to_xy() with black
Fixes: floating point division by 0
Fixes: undefined behavior in handling NaN
Fixes: Ticket 8268
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3d500e62f6206ad11308b18976246366aed8c1a5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_ciescope.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_ciescope.c b/libavfilter/vf_ciescope.c index 7c0cfed061..311696817d 100644 --- a/libavfilter/vf_ciescope.c +++ b/libavfilter/vf_ciescope.c @@ -842,7 +842,8 @@ rgb_to_xy(double rc, *z = m[2][0] * rc + m[2][1] * gc + m[2][2] * bc; sum = *x + *y + *z; - + if (sum == 0) + sum = 1; *x = *x / sum; *y = *y / sum; } |