From: Tobias Markus Date: Thu, 12 Sep 2013 12:26:29 +0000 (+0200) Subject: Issue 1015: Adding null-checks to GLRenderer::draw_surface X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4f4c175a7acc36b210acc153478e28c954917f66;p=supertux.git Issue 1015: Adding null-checks to GLRenderer::draw_surface --- diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp index 0e66433c4..14d64e88b 100644 --- a/src/video/gl/gl_renderer.cpp +++ b/src/video/gl/gl_renderer.cpp @@ -114,8 +114,20 @@ void GLRenderer::draw_surface(const DrawingRequest& request) { const Surface* surface = (const Surface*) request.request_data; + if(surface == NULL) + { + return; + } GLTexture* gltexture = static_cast(surface->get_texture().get()); + if(gltexture == NULL) + { + return; + } GLSurfaceData *surface_data = static_cast(surface->get_surface_data()); + if(surface_data == NULL) + { + return; + } GLuint th = gltexture->get_handle(); if (th != last_texture) {