Windows build crashes when trying to load a corrupted jpg, fixes #5366

This commit is contained in:
Ingo Weyrich
2019-07-06 12:58:53 +02:00
parent 6fa533c40b
commit 0f09559413
2 changed files with 8 additions and 0 deletions

View File

@@ -245,7 +245,11 @@ my_error_exit (j_common_ptr cinfo)
j_decompress_ptr dinfo = (j_decompress_ptr)cinfo;
// longjmp (((rt_jpeg_error_mgr*)(dinfo->src))->error_jmp_buf, 1);
#if defined( WIN32 ) && defined( __x86_64__ ) && !defined(__clang__)
__builtin_longjmp ((reinterpret_cast<rt_jpeg_error_mgr*>(dinfo->src)) ->error_jmp_buf, 1);
#else
longjmp ((reinterpret_cast<rt_jpeg_error_mgr*>(dinfo->src)) ->error_jmp_buf, 1);
#endif
}