From 9edc984b090ca585c0850fa05e0cecac86679638 Mon Sep 17 00:00:00 2001 From: est31 Date: Wed, 3 Aug 2016 23:20:36 +0200 Subject: [PATCH] Porting: Fix endless loop if image format is not recognized --- src/porting.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;