summaryrefslogtreecommitdiff
path: root/libavfilter/vsrc_color.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-07-15 09:47:01 +0200
committerAnton Khirnov <anton@khirnov.net>2012-07-22 09:14:05 +0200
commit3825b5268844694ff50a0e0bfde64df43a862fae (patch)
tree3cb8456333c0a5a1af8f7d2c557174181ff1c6c5 /libavfilter/vsrc_color.c
parentd4f89906e3b310609b636cf6071313ec557ec873 (diff)
lavfi: check all ff_start_frame/draw_slice/end_frame calls for errors
Diffstat (limited to 'libavfilter/vsrc_color.c')
-rw-r--r--libavfilter/vsrc_color.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libavfilter/vsrc_color.c b/libavfilter/vsrc_color.c
index d5bda2b698..c17f54f39d 100644
--- a/libavfilter/vsrc_color.c
+++ b/libavfilter/vsrc_color.c
@@ -142,19 +142,29 @@ 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);
+ int ret;
+
picref->video->pixel_aspect = (AVRational) {1, 1};
picref->pts = color->pts++;
picref->pos = -1;
- ff_start_frame(link, avfilter_ref_buffer(picref, ~0));
+ ret = ff_start_frame(link, avfilter_ref_buffer(picref, ~0));
+ if (ret < 0)
+ goto fail;
+
ff_draw_rectangle(picref->data, picref->linesize,
color->line, color->line_step, color->hsub, color->vsub,
0, 0, color->w, color->h);
- ff_draw_slice(link, 0, color->h, 1);
- ff_end_frame(link);
+ ret = ff_draw_slice(link, 0, color->h, 1);
+ if (ret < 0)
+ goto fail;
+
+ ret = ff_end_frame(link);
+
+fail:
avfilter_unref_buffer(picref);
- return 0;
+ return ret;
}
AVFilter avfilter_vsrc_color = {