Issue 1015: Adding null-checks to GLRenderer::draw_surface
authorTobias Markus <tobbi@mozilla-uk.org>
Thu, 12 Sep 2013 12:26:29 +0000 (14:26 +0200)
committerTobias Markus <tobbi@mozilla-uk.org>
Thu, 12 Sep 2013 12:26:29 +0000 (14:26 +0200)
src/video/gl/gl_renderer.cpp

index 0e66433..14d64e8 100644 (file)
@@ -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<GLTexture*>(surface->get_texture().get());
+  if(gltexture == NULL)
+  {
+    return;
+  }
   GLSurfaceData *surface_data = static_cast<GLSurfaceData*>(surface->get_surface_data());
+  if(surface_data == NULL)
+  {
+    return;
+  }
 
   GLuint th = gltexture->get_handle();
   if (th != last_texture) {