From d515e9c2259dd825b167a94266efd5336a711702 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 15 Jul 2012 09:50:49 +0200 Subject: [PATCH] vf_fps: fix a memleak on malloc failure. --- libavfilter/vf_fps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index ab7cba57d1..bf140f8143 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -161,8 +161,10 @@ static int write_to_fifo(AVFifoBuffer *fifo, AVFilterBufferRef *buf) int ret; if (!av_fifo_space(fifo) && - (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo)))) + (ret = av_fifo_realloc2(fifo, 2*av_fifo_size(fifo)))) { + avfilter_unref_bufferp(&buf); return ret; + } av_fifo_generic_write(fifo, &buf, sizeof(buf), NULL); return 0;