From 45042dffbc14bdb43d95ddcb72da14d85f2adc1b Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Mon, 19 Oct 2009 21:59:23 +0300 Subject: [PATCH] cacasink: exit properly when invalid driver has been selected. See #599018. --- ext/libcaca/gstcacasink.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/libcaca/gstcacasink.c b/ext/libcaca/gstcacasink.c index 07bd47e0bb..8102fff759 100644 --- a/ext/libcaca/gstcacasink.c +++ b/ext/libcaca/gstcacasink.c @@ -350,7 +350,12 @@ static gboolean gst_cacasink_open (GstCACASink * cacasink) { cacasink->bitmap = NULL; - caca_init (); + + if (caca_init () < 0) { + GST_ELEMENT_ERROR (cacasink, RESOURCE, OPEN_WRITE, (NULL), + ("caca_init() failed")); + return FALSE; + } cacasink->screen_width = caca_get_width (); cacasink->screen_height = caca_get_height ();