[vlc-commits] decoder: fix vlc_objres_clear() call site

Rémi Denis-Courmont git at videolan.org
Thu Jul 18 17:47:25 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 17 23:16:10 2019 +0300| [2d269bdc00cde974ff3a8fdc857833b3467cf4c6] | committer: Rémi Denis-Courmont

decoder: fix vlc_objres_clear() call site

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2d269bdc00cde974ff3a8fdc857833b3467cf4c6
---

 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 015f6341b5..6d5b0050ed 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;
     }



More information about the vlc-commits mailing list