You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avfilter/vf_w3fdif: Fix segfault on allocation error
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -275,7 +275,7 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
AVFilterContext *ctx = inlink->dst;
|
AVFilterContext *ctx = inlink->dst;
|
||||||
W3FDIFContext *s = ctx->priv;
|
W3FDIFContext *s = ctx->priv;
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
|
||||||
int ret, i, depth;
|
int ret, i, depth, nb_threads;
|
||||||
|
|
||||||
if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
|
if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -289,10 +289,11 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
}
|
}
|
||||||
|
|
||||||
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
|
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
|
||||||
s->nb_threads = ff_filter_get_nb_threads(ctx);
|
nb_threads = ff_filter_get_nb_threads(ctx);
|
||||||
s->work_line = av_calloc(s->nb_threads, sizeof(*s->work_line));
|
s->work_line = av_calloc(nb_threads, sizeof(*s->work_line));
|
||||||
if (!s->work_line)
|
if (!s->work_line)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
s->nb_threads = nb_threads;
|
||||||
|
|
||||||
for (i = 0; i < s->nb_threads; i++) {
|
for (i = 0; i < s->nb_threads; i++) {
|
||||||
s->work_line[i] = av_calloc(FFALIGN(s->linesize[0], 32), sizeof(*s->work_line[0]));
|
s->work_line[i] = av_calloc(FFALIGN(s->linesize[0], 32), sizeof(*s->work_line[0]));
|
||||||
|
Reference in New Issue
Block a user