From afca8d2900d922c5757c5e95599f74437f14f7e5 Mon Sep 17 00:00:00 2001 From: David Sansome Date: Mon, 7 Jun 2010 14:51:47 +0000 Subject: [PATCH] Fix some weird crashes on windows --- 3rdparty/libprojectm/PresetLoader.cpp | 2 ++ .../libprojectm/Renderer/TextureManager.cpp | 2 +- .../patches/05-fix-windows-crashes.patch | 26 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 3rdparty/libprojectm/patches/05-fix-windows-crashes.patch diff --git a/3rdparty/libprojectm/PresetLoader.cpp b/3rdparty/libprojectm/PresetLoader.cpp index 94e46b925..e0afec582 100644 --- a/3rdparty/libprojectm/PresetLoader.cpp +++ b/3rdparty/libprojectm/PresetLoader.cpp @@ -84,6 +84,8 @@ void PresetLoader::rescan() while ( ( dir_entry = readdir ( _dir ) ) != NULL ) { + if (dir_entry->d_name == 0) + continue; std::ostringstream out; // Convert char * to friendly string diff --git a/3rdparty/libprojectm/Renderer/TextureManager.cpp b/3rdparty/libprojectm/Renderer/TextureManager.cpp index 76f4ffd1e..a54ae59c0 100644 --- a/3rdparty/libprojectm/Renderer/TextureManager.cpp +++ b/3rdparty/libprojectm/Renderer/TextureManager.cpp @@ -219,7 +219,7 @@ void TextureManager::loadTextureDir() // Allocate a new a stream given the current directory name if ((m_dir = opendir(dirname.c_str())) == NULL) { - std::cout<<"No Textures Loaded from "<d_name == 0) ++ continue; + + std::ostringstream out; + // Convert char * to friendly string