From d197f2cb5d6982a05c2a56f27995dcbd14d2ef08 Mon Sep 17 00:00:00 2001 From: Torsten Jager Date: Thu, 22 Aug 2013 16:48:45 +0200 Subject: video_out_opengl2: skip rendering into invalid drawable Tested by provoking a Kaffeine segfault. --- src/video_out/video_out_opengl2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/video_out/video_out_opengl2.c b/src/video_out/video_out_opengl2.c index fed693af0..aadfca107 100644 --- a/src/video_out/video_out_opengl2.c +++ b/src/video_out/video_out_opengl2.c @@ -1158,7 +1158,10 @@ static void opengl2_draw_video_bilinear( opengl2_driver_t *that, int guiw, int g static void opengl2_draw( opengl2_driver_t *that, opengl2_frame_t *frame ) { - glXMakeCurrent( that->display, that->drawable, that->context ); + if ( !glXMakeCurrent( that->display, that->drawable, that->context ) ) { + xprintf( that->xine, XINE_VERBOSITY_LOG, "video_out_opengl2: display unavailable for rendering\n" ); + return; + } if ( !opengl2_check_textures_size( that, frame->width, frame->height ) ) { glXMakeCurrent( that->display, None, NULL ); -- cgit v1.2.3