From: jstebbins Date: Thu, 16 Jul 2009 17:29:17 +0000 (+0000) Subject: LinGui: fix crash on empty buffer from stderr X-Git-Tag: 0.9.4~265 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=149a32aa1e1ff4ac32f683d0444c70f625e8fb0b;p=handbrake LinGui: fix crash on empty buffer from stderr somehow, i'm getting a buffer that has nothing but a '\0' char g_io_channel_write_chars gets really upset about the nil character and crashes git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2697 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 54a5d0ca2..bccc03005 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2628,7 +2628,7 @@ ghb_log_cb(GIOChannel *source, GIOCondition cond, gpointer data) signal_user_data_t *ud = (signal_user_data_t*)data; status = g_io_channel_read_line (source, &text, &length, NULL, &gerror); - if (text != NULL) + if (text != NULL && length > 0 && text[length-1] != 0) { GdkWindow *window; gint width, height;