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=06096cd1bed6ac3b4afa02af49d80bc6caf8e6ee;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 18e3874b6..b16652961 100644 --- a/src/video/gl/gl_renderer.cpp +++ b/src/video/gl/gl_renderer.cpp @@ -118,8 +118,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) {