You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avfilter/vf_zscale: fix leaks in fast/bypass path
This commit is contained in:
@@ -760,15 +760,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
||||
AVFrame *out = NULL;
|
||||
ThreadData td;
|
||||
|
||||
if (!(out = ff_get_video_buffer(outlink, outlink->w, outlink->h))) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
av_frame_copy_props(out, in);
|
||||
out->width = outlink->w;
|
||||
out->height = outlink->h;
|
||||
|
||||
//we need to use this filter if something is different for an input and output only
|
||||
//otherwise - just copy the input frame to the output
|
||||
if ((link->w != outlink->w) ||
|
||||
@@ -783,6 +774,14 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
||||
(s->src_format.pixel_type !=s->dst_format.pixel_type) ||
|
||||
(s->src_format.transfer_characteristics !=s->dst_format.transfer_characteristics)
|
||||
){
|
||||
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
|
||||
if (!out) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
av_frame_copy_props(out, in);
|
||||
|
||||
if ((ret = realign_frame(desc, &in)) < 0)
|
||||
goto fail;
|
||||
|
||||
@@ -879,8 +878,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
|
||||
memset(out->data[3] + y * out->linesize[3], 0xff, outlink->w);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/*no need for any filtering */
|
||||
return ff_filter_frame(outlink, in);
|
||||
}
|
||||
|
Reference in New Issue
Block a user