[FFmpeg-cvslog] vf_fps: fix a memleak on malloc failure.
Anton Khirnov
git at videolan.org
Sun Jul 22 23:56:49 CEST 2012
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Jul 15 09:50:49 2012 +0200| [d515e9c2259dd825b167a94266efd5336a711702] | committer: Anton Khirnov
vf_fps: fix a memleak on malloc failure.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d515e9c2259dd825b167a94266efd5336a711702
---
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 ab7cba5..bf140f8 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;
More information about the ffmpeg-cvslog
mailing list