[vlc-devel] [PATCH 3/3] decoder: fix vlc_objres_clear() call site

RĂ©mi Denis-Courmont remi at remlab.net
Wed Jul 17 22:17:25 CEST 2019


---
 src/input/decoder_helpers.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index 15da9a6861..ce83508be0 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -107,6 +107,10 @@ static int decoder_device_Open(void *func, bool forced, va_list ap)
     int ret = open(device, window);
     if (ret != VLC_SUCCESS)
     {
+        struct vlc_decoder_device_priv *priv =
+            container_of(device, struct vlc_decoder_device_priv, device);
+
+        vlc_objres_clear(VLC_OBJECT(&priv->device));
         device->sys = NULL;
         device->type = VLC_DECODER_DEVICE_NONE;
         device->opaque = NULL;
@@ -133,7 +137,6 @@ vlc_decoder_device_Create(vout_window_t *window)
     free(name);
     if (module == NULL)
     {
-        vlc_objres_clear(VLC_OBJECT(&priv->device));
         vlc_object_delete(&priv->device);
         return NULL;
     }
-- 
2.22.0



More information about the vlc-devel mailing list