From 7e21e35eac80155181dd3a6d0015d3115b6d275a Mon Sep 17 00:00:00 2001 From: Ognyan Tonchev Date: Tue, 16 Sep 2014 11:42:34 +0200 Subject: [PATCH] glfilter: do not leak pool in error cases https://bugzilla.gnome.org/show_bug.cgi?id=736732 --- gst-libs/gst/gl/gstglfilter.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 397e866485..e8c8710c13 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -1003,22 +1003,6 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query) guint in_width, in_height, out_width, out_height; GstGLContext *other_context = NULL; - gst_query_parse_allocation (query, &caps, NULL); - - if (gst_query_get_n_allocation_pools (query) > 0) { - gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); - - update_pool = TRUE; - } else { - GstVideoInfo vinfo; - - gst_video_info_init (&vinfo); - gst_video_info_from_caps (&vinfo, caps); - size = vinfo.size; - min = max = 0; - update_pool = FALSE; - } - if (!gst_gl_ensure_display (filter, &filter->display)) return FALSE; @@ -1116,6 +1100,22 @@ gst_gl_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query) goto error; } + gst_query_parse_allocation (query, &caps, NULL); + + if (gst_query_get_n_allocation_pools (query) > 0) { + gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); + + update_pool = TRUE; + } else { + GstVideoInfo vinfo; + + gst_video_info_init (&vinfo); + gst_video_info_from_caps (&vinfo, caps); + size = vinfo.size; + min = max = 0; + update_pool = FALSE; + } + if (!pool) pool = gst_gl_buffer_pool_new (filter->context);