diff mbox series

[FFmpeg-devel,1/2] avfilter/vf_uspp: Fix leak of qp-table on error

Message ID 20210312142407.2034015-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 0858853241925d0a45f58a4724f203d284a70f00
Headers show
Series [FFmpeg-devel,1/2] avfilter/vf_uspp: Fix leak of qp-table on error | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt March 12, 2021, 2:24 p.m. UTC
Fixes Coverity issue #1473500.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
Why does the new qp API actually need to allocate the qp table (instead
of reusing the side-data qp)?

 libavfilter/vf_uspp.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer March 12, 2021, 5:28 p.m. UTC | #1
On Fri, Mar 12, 2021 at 03:24:06PM +0100, Andreas Rheinhardt wrote:
> Fixes Coverity issue #1473500.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---

should be ok



[...]
diff mbox series

Patch

diff --git a/libavfilter/vf_uspp.c b/libavfilter/vf_uspp.c
index 8b39f53c3d..b77edeb244 100644
--- a/libavfilter/vf_uspp.c
+++ b/libavfilter/vf_uspp.c
@@ -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);