diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-08 17:29:42 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-22 09:14:04 +0200 |
commit | ebc8d974817fe456a0afe6867fdeb22c761fb04f (patch) | |
tree | d08864445a712ca289ef8a1b2a4fa4d7ff2e81e0 /libavfilter/vf_fieldorder.c | |
parent | 1470ce21cec5ee26e106e2a884c26bbf84e5aaea (diff) | |
download | ffmpeg-ebc8d974817fe456a0afe6867fdeb22c761fb04f.tar.gz |
lavfi: add error handling to start_frame().
Diffstat (limited to 'libavfilter/vf_fieldorder.c')
-rw-r--r-- | libavfilter/vf_fieldorder.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c index 754cccd885..0a8af75851 100644 --- a/libavfilter/vf_fieldorder.c +++ b/libavfilter/vf_fieldorder.c @@ -116,18 +116,32 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *inlink, int perms, int return ff_get_video_buffer(outlink, perms, w, h); } -static void start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) +static int start_frame(AVFilterLink *inlink, AVFilterBufferRef *inpicref) { AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = ctx->outputs[0]; AVFilterBufferRef *outpicref, *for_next_filter; + int ret = 0; outpicref = avfilter_ref_buffer(inpicref, ~0); - outlink->out_buf = outpicref; + if (!outpicref) + return AVERROR(ENOMEM); for_next_filter = avfilter_ref_buffer(outpicref, ~0); - ff_start_frame(outlink, for_next_filter); + if (!for_next_filter) { + avfilter_unref_bufferp(&outpicref); + return AVERROR(ENOMEM); + } + + ret = ff_start_frame(outlink, for_next_filter); + if (ret < 0) { + avfilter_unref_bufferp(&outpicref); + return ret; + } + + outlink->out_buf = outpicref; + return 0; } static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) |