From 821ebaf57c3c02c2d74a1b87055bb55d88d9ae70 Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Sat, 14 Feb 2015 17:07:49 +0100 Subject: [PATCH] Fix coverity #29405: Unchecked dynamic_cast --- src/video/texture_manager.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index e7c392f6f..6dba671a4 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -259,7 +259,11 @@ TextureManager::save_textures() for(ImageTextures::iterator i = m_image_textures.begin(); i != m_image_textures.end(); ++i) { - save_texture(dynamic_cast(i->second.lock().get())); + GLTexture* texture = dynamic_cast(i->second.lock().get()); + if(texture == NULL) + continue; + + save_texture(texture); } } -- 2.11.0