vtdec: fix leak of CMFormatDescription
authorRoman Shpuntov <roman.shpuntov@gmail.com>
Wed, 30 Oct 2019 07:56:41 +0000 (14:56 +0700)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 4 Nov 2019 12:12:57 +0000 (12:12 +0000)
There was consideration for replacing the CMFormatDescription used
on format changes in `set_format()` however on shutdown, we were
leaking the CMFormatDescription at the end of processing.

'https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1106'

sys/applemedia/vtdec.c

index 5e1bb055d3aa091dc1534e139cea5a293b5fab80..705a70d4b38c493ccbbf35bcd70125dee24466e8 100644 (file)
@@ -205,6 +205,10 @@ gst_vtdec_stop (GstVideoDecoder * decoder)
     gst_gl_context_helper_free (vtdec->ctxh);
   vtdec->ctxh = NULL;
 
+  if (vtdec->format_description)
+    CFRelease (vtdec->format_description);
+  vtdec->format_description = NULL;
+
   GST_DEBUG_OBJECT (vtdec, "stop");
 
   return TRUE;