minddata catch jpeg errexit runtime error

This commit is contained in:
xiefangqi 2020-09-28 10:39:06 +08:00
parent 90895accb0
commit 1dc50a2302
1 changed files with 7 additions and 1 deletions

View File

@ -161,7 +161,13 @@ static void JpegInitSource(j_decompress_ptr cinfo) {}
static boolean JpegFillInputBuffer(j_decompress_ptr cinfo) { static boolean JpegFillInputBuffer(j_decompress_ptr cinfo) {
if (cinfo->src->bytes_in_buffer == 0) { if (cinfo->src->bytes_in_buffer == 0) {
ERREXIT(cinfo, JERR_INPUT_EMPTY); // Under ARM platform raise runtime_error may cause core problem,
// so we catch runtime_error and just return FALSE.
try {
ERREXIT(cinfo, JERR_INPUT_EMPTY);
} catch (std::runtime_error &e) {
return FALSE;
}
return FALSE; return FALSE;
} }
return TRUE; return TRUE;