vaapidecode: plug a memory leak.
authorMatthew Waters <ystreet00@gmail.com>
Sat, 22 Feb 2014 14:43:39 +0000 (01:43 +1100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Wed, 18 Jun 2014 11:58:49 +0000 (13:58 +0200)
It can happen that there is a pool provided that does not advertise
the vappivideometa. We should unref that pool before using our own.

Discovered with vaapidecode ! {glimagesink,cluttersink}

https://bugzilla.gnome.org/show_bug.cgi?id=724957

[fixed compilation by adding the missing semi-colon]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
gst/vaapi/gstvaapidecode.c

index 2d2e319..da422e2 100644 (file)
@@ -548,6 +548,8 @@ gst_vaapidecode_decide_allocation(GstVideoDecoder *vdec, GstQuery *query)
             GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META)) {
         GST_INFO("no pool or doesn't support GstVaapiVideoMeta, "
             "making new pool");
+        if (pool)
+            gst_object_unref(pool);
         pool = gst_vaapi_video_buffer_pool_new(
             GST_VAAPI_PLUGIN_BASE_DISPLAY(decode));
         if (!pool)