From d94915c5150d9262b6d44cdac9982df38951ff8f Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 10 Mar 2016 17:31:35 -0800 Subject: [PATCH] GUAC-236: Ensure display allocation can handle video preparation failures. --- src/guacenc/display.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/guacenc/display.c b/src/guacenc/display.c index f83bbb4a..baf6845d 100644 --- a/src/guacenc/display.c +++ b/src/guacenc/display.c @@ -87,13 +87,18 @@ cairo_operator_t guacenc_display_cairo_operator(guac_composite_mode mask) { guacenc_display* guacenc_display_alloc() { + /* STUB: Prepare video encoding */ + guacenc_video* video = + guacenc_video_alloc("/tmp/test.mpg", 640, 480, 25, 400000); + if (video == NULL) + return NULL; + /* Allocate display */ guacenc_display* display = (guacenc_display*) calloc(1, sizeof(guacenc_display)); - /* STUB: Prepare video encoding */ - display->output = guacenc_video_alloc("/tmp/test.mpg", - 640, 480, 25, 400000); + /* Associate display with video output */ + display->output = video; return display;