avfilter/vf_elbg: stop leaking frame on error
authorPaul B Mahol <onemda@gmail.com>
Wed, 2 Oct 2019 08:54:45 +0000 (10:54 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 2 Oct 2019 08:54:45 +0000 (10:54 +0200)
libavfilter/vf_elbg.c

index 396af82..b59da9e 100644 (file)
@@ -178,8 +178,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
         AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
         uint32_t *pal;
 
-        if (!out)
+        if (!out) {
+            av_frame_free(&frame);
             return AVERROR(ENOMEM);
+        }
         out->pts = frame->pts;
         av_frame_free(&frame);
         pal = (uint32_t *)out->data[1];