]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_uspp: Fix leak of qp-table on error
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 12 Mar 2021 13:55:53 +0000 (14:55 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 12 Mar 2021 18:05:11 +0000 (19:05 +0100)
Fixes Coverity issue #1473500.

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

index 8b39f53c3de9bdcdd50758d67db849b360fc8693..b77edeb244459ab3dab28d6b8add5ebcec1e8156 100644 (file)
@@ -425,6 +425,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
                 out = ff_get_video_buffer(outlink, aligned_w, aligned_h);
                 if (!out) {
                     av_frame_free(&in);
+                    if (qp_table != uspp->non_b_qp_table)
+                        av_free(qp_table);
                     return AVERROR(ENOMEM);
                 }
                 av_frame_copy_props(out, in);