You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avfilter/vf_exposure: ensure that scale is always > 0
This commit is contained in:
@@ -67,8 +67,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
|
|||||||
{
|
{
|
||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
ExposureContext *s = ctx->priv;
|
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,
|
ff_filter_execute(ctx, s->do_slice, frame, NULL,
|
||||||
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
FFMIN(frame->height, ff_filter_get_nb_threads(ctx)));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user