diff options
author | est31 <MTest31@outlook.com> | 2016-08-03 23:20:36 +0200 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2016-08-03 23:33:04 +0200 |
commit | 9edc984b090ca585c0850fa05e0cecac86679638 (patch) | |
tree | e1bfaa3d273bb1304c59bbea93d7984b7d4cc0fb /src | |
parent | e559f8714bc2a995fa7867022ef3002107ae1cc6 (diff) | |
download | minetest-9edc984b090ca585c0850fa05e0cecac86679638.tar.gz minetest-9edc984b090ca585c0850fa05e0cecac86679638.tar.bz2 minetest-9edc984b090ca585c0850fa05e0cecac86679638.zip |
Porting: Fix endless loop if image format is not recognized
Diffstat (limited to 'src')
-rw-r--r-- | src/porting.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/porting.cpp b/src/porting.cpp index 15a18bdfb..acd047232 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -619,7 +619,8 @@ bool setXorgWindowIcon(IrrlichtDevice *device, video::IVideoDriver *v_driver = device->getVideoDriver(); video::IImageLoader *image_loader = NULL; - for (u32 i = v_driver->getImageLoaderCount() - 1; i >= 0; i--) { + u32 cnt = v_driver->getImageLoaderCount(); + for (u32 i = 0; i < cnt; i++) { if (v_driver->getImageLoader(i)->isALoadableFileExtension(icon_file.c_str())) { image_loader = v_driver->getImageLoader(i); break; |