In operators/vision/image_decoder.hpp there is this line:
# operators/vision/image_decoder.hpp : 137
cinfo.err = jpeg_std_error(&jerr); // sets what happens when libjpg has an error
The problem with this is that now cinfo.err() will call exit:
# libjpeg/src/jerror.c : 66
METHODDEF(void)
error_exit(j_common_ptr cinfo)
{
/* Always display the message */
(*cinfo->err->output_message) (cinfo);
/* Let the memory manager delete any temp files before we die */
jpeg_destroy(cinfo);
exit(EXIT_FAILURE);
}
Now, I have data being fed to generic models, and in this case when the data is invalid and given to an ImageDecoder node, my entire program just exits, instead of having an OrtStatus being returned.
I am running this with onnxruntime C api and usually models will just return an OrtStatus when they have an error. So I'm wondering if there is a workaround for this s.t. invalid images don't crash my program.
If this were to be changed, it could be that some other function that is not jpeg_std_error is used, s.t. cinfo.err doesn't call error_exit(), but instead sets an OrtStatus.
In
operators/vision/image_decoder.hppthere is this line:The problem with this is that now
cinfo.err()will callexit:Now, I have data being fed to generic models, and in this case when the data is invalid and given to an ImageDecoder node, my entire program just exits, instead of having an OrtStatus being returned.
I am running this with onnxruntime C api and usually models will just return an OrtStatus when they have an error. So I'm wondering if there is a workaround for this s.t. invalid images don't crash my program.
If this were to be changed, it could be that some other function that is not
jpeg_std_erroris used, s.t.cinfo.errdoesn't callerror_exit(), but instead sets an OrtStatus.