]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_dedot: Fix leak of AVFrame if making it writable fails
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 9 Feb 2020 18:40:34 +0000 (19:40 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 10 Feb 2020 23:03:44 +0000 (00:03 +0100)
Even in this scenario, the frame still contains references to data that
won't be freed if the frame isn't unreferenced. And the AVFrame itself
will leak, too.

Fixes Coverity issue #1441422.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavfilter/vf_dedot.c

index 1fb7bfe866a1f4a0fa925dee7a35e77feb4dada0..993ac8f74fc18cf67968c1666c9361c17b56de05 100644 (file)
@@ -313,7 +313,8 @@ static int activate(AVFilterContext *ctx)
                                                FFMIN(s->planeheight[2],
                                                ff_filter_get_nb_threads(ctx)));
                     }
-                }
+                } else
+                    av_frame_free(&out);
             } else if (!out) {
                 ret = AVERROR(ENOMEM);
             }