diff mbox series

[FFmpeg-devel,2/6] avutil/hwcontext_d3d11va: Free AVD3D11FrameDescriptor on error

Message ID 20240609154746.4173264-2-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/6] avutil/hwcontext_d3d11va: correct sizeof AVD3D11FrameDescriptor | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer June 9, 2024, 3:47 p.m. UTC
Fixes: CID1598558 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavutil/hwcontext_d3d11va.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/libavutil/hwcontext_d3d11va.c b/libavutil/hwcontext_d3d11va.c
index c04ab01a282..9b3c5f389fa 100644
--- a/libavutil/hwcontext_d3d11va.c
+++ b/libavutil/hwcontext_d3d11va.c
@@ -190,6 +190,7 @@  static AVBufferRef *wrap_texture_buf(AVHWFramesContext *ctx, ID3D11Texture2D *te
                                                    sizeof(*frames_hwctx->texture_infos));
         if (!frames_hwctx->texture_infos) {
             ID3D11Texture2D_Release(tex);
+            av_free(desc);
             return NULL;
         }
         s->nb_surfaces = s->nb_surfaces_used + 1;