From 2c21eefd7cb9369bc3d9b801d49379d6c09a4eab Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 16 Oct 2013 21:12:44 +0300 Subject: [PATCH 1/1] Guard against no image loaders being enabled --- source/graphics/imageloader.cpp | 3 +++ 1 file changed, 3 insertions(+) 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()); -- 2.45.2