Commit 0ccab4d2 authored by Tommi Myöhänen's avatar Tommi Myöhänen Committed by Wim Taymans

sys/: Don't leak the PAR on errors. Fixes #496731.

Original commit message from CVS:
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_change_state):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get):
Don't leak the PAR on errors. Fixes #496731.
parent dffc29eb
2007-11-16 Wim Taymans <wim.taymans@gmail.com>
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_change_state):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get):
Don't leak the PAR on errors. Fixes #496731.
2007-11-16 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/tag/gstid3tag.c: (user_tag_matches),
......@@ -1214,6 +1214,7 @@ gst_ximagesink_xcontext_get (GstXImageSink * ximagesink)
if (!px_formats) {
XCloseDisplay (xcontext->disp);
g_mutex_unlock (ximagesink->x_lock);
g_free (xcontext->par);
g_free (xcontext);
return NULL;
}
......
......@@ -1645,7 +1645,6 @@ gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
GST_DEBUG_OBJECT (xvimagesink, "X reports %dx%d pixels and %d mm x %d mm",
xcontext->width, xcontext->height, xcontext->widthmm, xcontext->heightmm);
gst_xvimagesink_calculate_pixel_aspect_ratio (xcontext);
/* We get supported pixmap formats at supported depth */
px_formats = XListPixmapFormats (xcontext->disp, &nb_formats);
......@@ -1653,6 +1652,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
if (!px_formats) {
XCloseDisplay (xcontext->disp);
g_mutex_unlock (xvimagesink->x_lock);
g_free (xcontext->par);
g_free (xcontext);
GST_ELEMENT_ERROR (xvimagesink, RESOURCE, SETTINGS,
("Could not initialise Xv output"), ("Could not get pixel formats"));
......@@ -1690,6 +1690,7 @@ gst_xvimagesink_xcontext_get (GstXvImageSink * xvimagesink)
if (!xcontext->caps) {
XCloseDisplay (xcontext->disp);
g_mutex_unlock (xvimagesink->x_lock);
g_free (xcontext->par);
g_free (xcontext);
/* GST_ELEMENT_ERROR is thrown by gst_xvimagesink_get_xv_support */
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment