]> git.tdb.fi Git - libs/gui.git/commitdiff
Guard against no image loaders being enabled
authorMikko Rasa <tdb@tdb.fi>
Wed, 16 Oct 2013 18:12:44 +0000 (21:12 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 16 Oct 2013 18:12:44 +0000 (21:12 +0300)
source/graphics/imageloader.cpp

index 15f0e50f7e14b1142f2ce664f542d7f4fbcd7618..06b70d16862e890997fd274b91cb0da7ff3e273a 100644 (file)
@@ -43,6 +43,9 @@ ImageLoader *ImageLoader::open_io(IO::Seekable &io)
                loaders.sort(signature_size_compare);
        }
 
+       if(loaders.empty())
+               throw unsupported_image_format("no loaders");
+
        vector<char> sig_buf(loaders.back()->get_signature_size());
        unsigned sig_len = io.read(&sig_buf[0], sig_buf.size());
        string signature(sig_buf.begin(), sig_buf.end());