[FFmpeg-cvslog] avfilter/paletteuse: fix leak in case of error

Clément Bœsch git at videolan.org
Wed Feb 18 14:04:14 CET 2015


ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Wed Feb 18 13:48:41 2015 +0100| [f40266560b85f9a4b9b2864a52bb60886af8ee0b] | committer: Clément Bœsch

avfilter/paletteuse: fix leak in case of error

Fixes CID1270819

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f40266560b85f9a4b9b2864a52bb60886af8ee0b
---

 libavfilter/vf_paletteuse.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index b36f72e..a8defc7 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -119,8 +119,12 @@ static int query_formats(AVFilterContext *ctx)
     AVFilterFormats *in    = ff_make_format_list(in_fmts);
     AVFilterFormats *inpal = ff_make_format_list(inpal_fmts);
     AVFilterFormats *out   = ff_make_format_list(out_fmts);
-    if (!in || !inpal || !out)
+    if (!in || !inpal || !out) {
+        av_freep(&in);
+        av_freep(&inpal);
+        av_freep(&out);
         return AVERROR(ENOMEM);
+    }
     ff_formats_ref(in,    &ctx->inputs[0]->out_formats);
     ff_formats_ref(inpal, &ctx->inputs[1]->out_formats);
     ff_formats_ref(out,   &ctx->outputs[0]->in_formats);



More information about the ffmpeg-cvslog mailing list