From: Mikko Rasa Date: Wed, 16 Oct 2013 18:12:44 +0000 (+0300) Subject: Guard against no image loaders being enabled X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=2c21eefd7cb9369bc3d9b801d49379d6c09a4eab;p=libs%2Fgui.git Guard against no image loaders being enabled --- diff --git a/source/graphics/imageloader.cpp b/source/graphics/imageloader.cpp index 15f0e50..06b70d1 100644 --- a/source/graphics/imageloader.cpp +++ b/source/graphics/imageloader.cpp @@ -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 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());