From 2ce0c7fc1c33de76b816144df2978518ec6738f6 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 8 Jan 2017 13:40:46 +0200 Subject: [PATCH] Initialize longjmp target before calling jpeg_create_decompress --- source/graphics/jpeg/jpegloader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/graphics/jpeg/jpegloader.cpp b/source/graphics/jpeg/jpegloader.cpp index 38df348..39866c1 100644 --- a/source/graphics/jpeg/jpegloader.cpp +++ b/source/graphics/jpeg/jpegloader.cpp @@ -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; -- 2.45.2