summaryrefslogtreecommitdiff
path: root/libavfilter/vf_vflip.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter/vf_vflip.c')
-rw-r--r--libavfilter/vf_vflip.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
index d7792670a6..3c06abaac9 100644
--- a/libavfilter/vf_vflip.c
+++ b/libavfilter/vf_vflip.c
@@ -52,6 +52,9 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
return ff_default_get_video_buffer(link, perms, w, h);
picref = ff_get_video_buffer(link->dst->outputs[0], perms, w, h);
+ if (!picref)
+ return NULL;
+
for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
@@ -64,12 +67,15 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
return picref;
}
-static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
+static int start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
{
FlipContext *flip = link->dst->priv;
AVFilterBufferRef *outpicref = avfilter_ref_buffer(inpicref, ~0);
int i;
+ if (!outpicref)
+ return AVERROR(ENOMEM);
+
for (i = 0; i < 4; i ++) {
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
@@ -79,14 +85,14 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
}
}
- ff_start_frame(link->dst->outputs[0], outpicref);
+ return ff_start_frame(link->dst->outputs[0], outpicref);
}
-static void draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
+static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
{
AVFilterContext *ctx = link->dst;
- ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
+ return ff_draw_slice(ctx->outputs[0], link->h - (y+h), h, -1 * slice_dir);
}
AVFilter avfilter_vf_vflip = {