From: Tobias Markus Date: Sat, 14 Feb 2015 16:07:49 +0000 (+0100) Subject: Fix coverity #29405: Unchecked dynamic_cast X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=821ebaf57c3c02c2d74a1b87055bb55d88d9ae70;p=supertux.git Fix coverity #29405: Unchecked dynamic_cast --- 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); } }