diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-07-15 11:16:53 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-07-22 09:14:05 +0200 |
commit | 1dc42050185d63c1de5d16146fbaee92640af187 (patch) | |
tree | e53dbbfc52894acf4efd526b9ddcaf1d0b87d94d /libavfilter/vsrc_color.c | |
parent | 80e4ed279b3abe9f5356e2b56255b2aa64527345 (diff) |
lavfi: check all avfilter_ref_buffer() calls for errors.
Diffstat (limited to 'libavfilter/vsrc_color.c')
-rw-r--r-- | libavfilter/vsrc_color.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c index c17f54f39d..0fa6853189 100644 --- a/libavfilter/vsrc_color.c +++ b/libavfilter/vsrc_color.c @@ -142,13 +142,20 @@ static int color_request_frame(AVFilterLink *link) { ColorContext *color = link->src->priv; AVFilterBufferRef *picref = ff_get_video_buffer(link, AV_PERM_WRITE, color->w, color->h); + AVFilterBufferRef *buf_out; int ret; picref->video->pixel_aspect = (AVRational) {1, 1}; picref->pts = color->pts++; picref->pos = -1; - ret = ff_start_frame(link, avfilter_ref_buffer(picref, ~0)); + buf_out = avfilter_ref_buffer(picref, ~0); + if (!buf_out) { + ret = AVERROR(ENOMEM); + goto fail; + } + + ret = ff_start_frame(link, buf_out); if (ret < 0) goto fail; |