Fix coverity #29405: Unchecked dynamic_cast
authorTobias Markus <tobbi@mozilla-uk.org>
Sat, 14 Feb 2015 16:07:49 +0000 (17:07 +0100)
committerTobias Markus <tobbi@mozilla-uk.org>
Sat, 14 Feb 2015 16:07:49 +0000 (17:07 +0100)
src/video/texture_manager.cpp

index e7c392f..6dba671 100644 (file)
@@ -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<GLTexture*>(i->second.lock().get()));
+    GLTexture* texture = dynamic_cast<GLTexture*>(i->second.lock().get());
+    if(texture == NULL)
+      continue;
+
+    save_texture(texture);
   }
 }