]> git.tdb.fi Git - libs/gui.git/commitdiff
Initialize longjmp target before calling jpeg_create_decompress
authorMikko Rasa <tdb@tdb.fi>
Sun, 8 Jan 2017 11:40:46 +0000 (13:40 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jan 2017 11:40:46 +0000 (13:40 +0200)
source/graphics/jpeg/jpegloader.cpp

index 38df34848f5b7ad0e04c1574d43a94aee90d4f6c..39866c18aaabaee7351f6fb2f419e8e3d4ab47ed 100644 (file)
@@ -91,6 +91,9 @@ JpegLoader::JpegLoader(IO::Seekable &io):
        priv->err_mgr.error_exit = &error_exit;
        priv->err_mgr.emit_message = &emit_message;
 
+       if(setjmp(priv->err_mgr.jmp))
+               throw runtime_error("error creating jpeg decompressor: "+priv->err_mgr.message);
+
        jpeg_create_decompress(&priv->jpeg);
 
        priv->jpeg.src = &priv->src_mgr;