Commit fc016fd6 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/vf_exposure: ensure that scale is always > 0

parent ec32c62c
......@@ -67,8 +67,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
{
AVFilterContext *ctx = inlink->dst;
ExposureContext *s = ctx->priv;
float diff = fabsf(exp2f(-s->exposure) - s->black);
s->scale = 1.f / (exp2f(-s->exposure) - s->black);
diff = diff > 0.f ? diff : 1.f / 1024.f;
s->scale = 1.f / diff;
ff_filter_execute(ctx, s->do_slice, frame, NULL,
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
......
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