diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-06-05 19:54:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-11 21:23:49 +0200 |
commit | a2d45c6b9a8fb713a48c282075105f99c9f27f3b (patch) | |
tree | 4a2d764ba136a904f1c671e297486dd9eac85e14 | |
parent | 226d608e952f65b0ffd11708a9ed8e8cd1fcf831 (diff) | |
download | ffmpeg-a2d45c6b9a8fb713a48c282075105f99c9f27f3b.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>
-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; } |