diff options
-rw-r--r-- | HISTORY | 5 | ||||
-rw-r--r-- | imageloader.c | 10 |
2 files changed, 10 insertions, 5 deletions
@@ -383,3 +383,8 @@ Version 1.0.0 - fixed a crash with dvb cards which deliver negative signal values - added theme darkredNG - updated ca_es po file + +Version 1.0.1 + +- fixed a bug in cImageLoader::FirstImageInFolder() + diff --git a/imageloader.c b/imageloader.c index c368370..047502b 100644 --- a/imageloader.c +++ b/imageloader.c @@ -153,12 +153,12 @@ bool cImageLoader::FirstImageInFolder(cString Path, cString Extension, cString * while (file = readdir(folder)) { if (endswith(file->d_name, *Extension)) { std::string fileName = file->d_name; - if (!fileName.compare(fileName.size()-8, 8, "_vdr.jpg")) + int strlen = fileName.length(); + if (strlen < 8) continue; - if (fileName.length() > 4) - fileName = fileName.substr(0, fileName.length() - 4); - else - return false; + if (!fileName.compare(strlen-8, 8, "_vdr.jpg")) + continue; + fileName = fileName.substr(0, strlen - 4); *recImage = fileName.c_str(); return true; } |