You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
ffmpeg_filter: Fix AVBufferSrcParameters leak
Fixed: CID1361950 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -728,7 +728,8 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
|||||||
|
|
||||||
if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
|
av_log(NULL, AV_LOG_ERROR, "Cannot connect video filter to audio input\n");
|
||||||
return AVERROR(EINVAL);
|
ret = AVERROR(EINVAL);
|
||||||
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fr.num)
|
if (!fr.num)
|
||||||
@@ -737,7 +738,7 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
|||||||
if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
if (ist->dec_ctx->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||||
ret = sub2video_prepare(ist);
|
ret = sub2video_prepare(ist);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
sar = ist->st->sample_aspect_ratio.num ?
|
sar = ist->st->sample_aspect_ratio.num ?
|
||||||
@@ -761,11 +762,11 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
|||||||
|
|
||||||
if ((ret = avfilter_graph_create_filter(&ifilter->filter, buffer_filt, name,
|
if ((ret = avfilter_graph_create_filter(&ifilter->filter, buffer_filt, name,
|
||||||
args.str, NULL, fg->graph)) < 0)
|
args.str, NULL, fg->graph)) < 0)
|
||||||
return ret;
|
goto fail;
|
||||||
par->hw_frames_ctx = ist->hw_frames_ctx;
|
par->hw_frames_ctx = ist->hw_frames_ctx;
|
||||||
ret = av_buffersrc_parameters_set(ifilter->filter, par);
|
ret = av_buffersrc_parameters_set(ifilter->filter, par);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
goto fail;
|
||||||
av_freep(&par);
|
av_freep(&par);
|
||||||
last_filter = ifilter->filter;
|
last_filter = ifilter->filter;
|
||||||
|
|
||||||
@@ -840,6 +841,10 @@ static int configure_input_video_filter(FilterGraph *fg, InputFilter *ifilter,
|
|||||||
if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
|
if ((ret = avfilter_link(last_filter, 0, in->filter_ctx, in->pad_idx)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
return 0;
|
return 0;
|
||||||
|
fail:
|
||||||
|
av_freep(&par);
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
|
||||||
|
Reference in New Issue
Block a user