summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2010-12-20 00:12:47 +0000
committerTor Andersson <tor@ghostscript.com>2010-12-20 00:12:47 +0000
commitc11468d5c6bb1ccdc57122497d34af67bba279f5 (patch)
tree906ccd1941780a84de4b7dc8a65a7022f25e9477 /fitz
parent9226be6fc39f4be98107681ccb08cbc7bbee87d2 (diff)
downloadmupdf-c11468d5c6bb1ccdc57122497d34af67bba279f5.tar.xz
Handle errors occurring while closing dctd.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/filt_dctd.c10
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);