Commit 3d500e62 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent ca9025f3
......@@ -849,7 +849,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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment