diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-12-20 00:12:47 +0000 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-12-20 00:12:47 +0000 |
commit | c11468d5c6bb1ccdc57122497d34af67bba279f5 (patch) | |
tree | 906ccd1941780a84de4b7dc8a65a7022f25e9477 /fitz | |
parent | 9226be6fc39f4be98107681ccb08cbc7bbee87d2 (diff) | |
download | mupdf-c11468d5c6bb1ccdc57122497d34af67bba279f5.tar.xz |
Handle errors occurring while closing dctd.
Diffstat (limited to 'fitz')
-rw-r--r-- | fitz/filt_dctd.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fitz/filt_dctd.c b/fitz/filt_dctd.c index 74e7bc40..97651297 100644 --- a/fitz/filt_dctd.c +++ b/fitz/filt_dctd.c @@ -182,8 +182,18 @@ static void closedctd(fz_stream *stm) { fz_dctd *state = stm->state; + + if (setjmp(state->jb)) + { + state->chain->rp = state->chain->wp - state->cinfo.src->bytes_in_buffer; + fz_warn("jpeg error: %s", state->msg); + goto skip; + } + if (state->init) jpeg_finish_decompress(&state->cinfo); + +skip: state->chain->rp = state->chain->wp - state->cinfo.src->bytes_in_buffer; jpeg_destroy_decompress(&state->cinfo); fz_free(state->scanline); |