diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-15 11:47:01 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-22 11:14:05 +0400 |
commit | 3825b5268844694ff50a0e0bfde64df43a862fae (patch) | |
tree | 3cb8456333c0a5a1af8f7d2c557174181ff1c6c5 /libavfilter/buffersrc.c | |
parent | d4f89906e3b310609b636cf6071313ec557ec873 (diff) |
lavfi: check all ff_start_frame/draw_slice/end_frame calls for errors
Diffstat (limited to 'libavfilter/buffersrc.c')
-rw-r--r-- | libavfilter/buffersrc.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 0828b153d8..2aa7d7d118 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -323,9 +323,10 @@ static int request_frame(AVFilterLink *link) switch (link->type) { case AVMEDIA_TYPE_VIDEO: - ff_start_frame(link, avfilter_ref_buffer(buf, ~0)); - ff_draw_slice(link, 0, link->h, 1); - ff_end_frame(link); + if ((ret = ff_start_frame(link, avfilter_ref_buffer(buf, ~0))) < 0 || + (ret = ff_draw_slice(link, 0, link->h, 1)) < 0 || + (ret = ff_end_frame(link)) < 0) + goto fail; break; case AVMEDIA_TYPE_AUDIO: ret = ff_filter_samples(link, avfilter_ref_buffer(buf, ~0)); @@ -334,6 +335,7 @@ static int request_frame(AVFilterLink *link) return AVERROR(EINVAL); } +fail: avfilter_unref_buffer(buf); return ret; |