Ensure jpeg exception object doesn't leak

This commit is contained in:
Ilya Fedin 2023-10-04 02:28:36 +04:00 committed by John Preston
parent ae7409b062
commit 93458e4cb3

View file

@ -1258,7 +1258,7 @@ bool IsProgressiveJpeg(const QByteArray &bytes) {
info.err = jpeg_std_error(&jerr);
jerr.error_exit = [](j_common_ptr cinfo) {
(*cinfo->err->output_message)(cinfo);
throw new std::exception;
throw std::exception();
};
jpeg_create_decompress(&info);
@ -1290,7 +1290,7 @@ QByteArray MakeProgressiveJpeg(const QByteArray &bytes) {
dstinfo.err = jpeg_std_error(&jerr);
jerr.error_exit = [](j_common_ptr cinfo) {
(*cinfo->err->output_message)(cinfo);
throw new std::exception;
throw std::exception();
};
jpeg_create_decompress(&srcinfo);