vf_interlace: check one av_frame_clone allocation
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 11 Nov 2013 00:04:17 +0000 (01:04 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 19 Nov 2013 13:48:36 +0000 (14:48 +0100)
libavfilter/vf_interlace.c

index aea4fdb..a05ab03 100644 (file)
@@ -185,6 +185,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
         av_log(ctx, AV_LOG_WARNING,
                "video is already interlaced, adjusting framerate only\n");
         out = av_frame_clone(s->cur);
         av_log(ctx, AV_LOG_WARNING,
                "video is already interlaced, adjusting framerate only\n");
         out = av_frame_clone(s->cur);
+        if (!out)
+            return AVERROR(ENOMEM);
         out->pts /= 2;  // adjust pts to new framerate
         ret = ff_filter_frame(outlink, out);
         s->got_output = 1;
         out->pts /= 2;  // adjust pts to new framerate
         ret = ff_filter_frame(outlink, out);
         s->got_output = 1;