summaryrefslogtreecommitdiff
path: root/print/mupdf/patches/patch-ad
blob: 3efb4c59d3a01d5707ff01015bf3bef6b0319acb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ad,v 1.1 2011/01/31 17:44:31 drochner Exp $

http://secunia.com/advisories/43020/

--- fitz/filt_dctd.c.orig	2010-08-25 14:12:11.000000000 +0000
+++ 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);