Commit d9481dcd authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit 'abb5e37f'

* commit 'abb5e37f':
  avfilter: fix leaks on error in ff_filter_frame

Conflicts:
	libavfilter/avfilter.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 8788d316 abb5e37f
......@@ -1024,13 +1024,18 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
case AVMEDIA_TYPE_AUDIO:
out = ff_get_audio_buffer(link, frame->nb_samples);
break;
default: return AVERROR(EINVAL);
default:
ret = AVERROR(EINVAL);
goto fail;
}
if (!out) {
av_frame_free(&frame);
return AVERROR(ENOMEM);
ret = AVERROR(ENOMEM);
goto fail;
}
av_frame_copy_props(out, frame);
ret = av_frame_copy_props(out, frame);
if (ret < 0)
goto fail;
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
......@@ -1043,7 +1048,9 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
av_get_channel_layout_nb_channels(frame->channel_layout),
frame->format);
break;
default: return AVERROR(EINVAL);
default:
ret = AVERROR(EINVAL);
goto fail;
}
av_frame_free(&frame);
......@@ -1076,6 +1083,11 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
link->frame_requested = 0;
ff_update_link_current_pts(link, pts);
return ret;
fail:
av_frame_free(&out);
av_frame_free(&frame);
return ret;
}
static int ff_filter_frame_needs_framing(AVFilterLink *link, AVFrame *frame)
......
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