From 8f3a3ce7307e39a030db3bf8d2e525b21e039ca2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 15 Jul 2012 11:16:53 +0200 Subject: lavfi: check all ff_get_video_buffer() calls for errors. --- libavfilter/vf_yadif.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavfilter/vf_yadif.c') diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index db4956c2cc..c6d78a5ae9 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -173,6 +173,9 @@ static int return_frame(AVFilterContext *ctx, int is_second) if (is_second) { yadif->out = ff_get_video_buffer(link, AV_PERM_WRITE | AV_PERM_PRESERVE | AV_PERM_REUSE, link->w, link->h); + if (!yadif->out) + return AVERROR(ENOMEM); + avfilter_copy_buffer_ref_props(yadif->out, yadif->cur); yadif->out->video->interlaced = 0; } @@ -239,6 +242,8 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref) yadif->out = ff_get_video_buffer(ctx->outputs[0], AV_PERM_WRITE | AV_PERM_PRESERVE | AV_PERM_REUSE, link->w, link->h); + if (!yadif->out) + return AVERROR(ENOMEM); avfilter_copy_buffer_ref_props(yadif->out, yadif->cur); yadif->out->video->interlaced = 0; -- cgit v1.2.3