[vlc-devel] [PATCH] display: release the video context if creating the converters failed

Steve Lhomme robux4 at ycbcr.xyz
Tue Jan 19 12:31:48 UTC 2021


The video context is held a few lines before. But we're not going to use it
anymore after this failure. No need to keep it any longer and
vout_display_Delete() is never going to be called since vout_display_New()
never returned a vout_display_t*.
---
 src/video_output/display.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index 9ada4bedd44..cc257708e30 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -738,6 +738,11 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
             vd->ops->close(vd);
         vlc_objres_clear(VLC_OBJECT(vd));
         video_format_Clean(&osys->display_fmt);
+        if (osys->src_vctx)
+        {
+            vlc_video_context_Release(osys->src_vctx);
+            osys->src_vctx = NULL;
+        }
         goto error;
     }
     return vd;
-- 
2.29.2



More information about the vlc-devel mailing list