From: est31 Date: Wed, 3 Aug 2016 21:20:36 +0000 (+0200) Subject: Porting: Fix endless loop if image format is not recognized X-Git-Tag: 0.4.15~295 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9edc984b090ca585c0850fa05e0cecac86679638;p=oweals%2Fminetest.git Porting: Fix endless loop if image format is not recognized --- 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;