Fixed crash due to DrawingRequestData being cast to the wrong type
authorIngo Ruhnke <grumbel@gmail.com>
Wed, 13 Aug 2014 17:18:38 +0000 (19:18 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Wed, 13 Aug 2014 17:18:54 +0000 (19:18 +0200)
src/video/gl/gl_lightmap.cpp

index d3fa721..48291a6 100644 (file)
@@ -148,7 +148,7 @@ GLLightmap::do_draw()
 void
 GLLightmap::draw_surface(const DrawingRequest& request)
 {
-  const Surface* surface = (const Surface*) request.request_data;
+  const Surface* surface = static_cast<const SurfaceRequest*>(request.request_data)->surface;
   boost::shared_ptr<GLTexture> gltexture = boost::dynamic_pointer_cast<GLTexture>(surface->get_texture());
   GLSurfaceData *surface_data = reinterpret_cast<GLSurfaceData *>(surface->get_surface_data());