~ubuntu-branches/ubuntu/lucid/ghostscript/lucid-updates

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#! /bin/sh /usr/share/dpatch/dpatch-run
# Description: fix denial of service or code execution via memory corruption
# Origin: backport, http://pkgs.fedoraproject.org/cgit/jasper.git/tree/jasper-CVE-2014-8158.patch
# Bug-RedHat: https://bugzilla.redhat.com/show_bug.cgi?id=1179298
# Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775970

@DPATCH@
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_qmfb.c ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_qmfb.c
--- ghostscript-8.71.dfsg.1~/jasper/src/libjasper/jpc/jpc_qmfb.c	2015-01-22 13:07:37.000000000 -0500
+++ ghostscript-8.71.dfsg.1/jasper/src/libjasper/jpc/jpc_qmfb.c	2015-01-22 13:09:15.028448719 -0500
@@ -159,12 +159,8 @@
   jpc_fix_t *hstartptr, int hstartind, int hendind)
 {
 	int bufsize = JPC_CEILDIVPOW2(endind - startind, 2);
-#if !defined(HAVE_VLA)
 #define QMFB_SPLITBUFSIZE 4096
 	jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE];
-#else
-	jpc_fix_t splitbuf[bufsize];
-#endif
 	jpc_fix_t *buf = splitbuf;
 	int llen;
 	int hlen;
@@ -180,7 +176,6 @@
 	llen = lendind - lstartind;
 	hlen = hendind - hstartind;
 
-#if !defined(HAVE_VLA)
 	/* Get a buffer. */
 	if (bufsize > QMFB_SPLITBUFSIZE) {
 		if (!(buf = jas_alloc2(bufsize, sizeof(jpc_fix_t)))) {
@@ -191,7 +186,6 @@
 			return;
 		}
 	}
-#endif
 
 	if (hstartind < lstartind) {
 		/* The first sample in the input signal is to appear
@@ -273,12 +267,10 @@
 		}
 	}
 
-#if !defined(HAVE_VLA)
 	/* If the split buffer was allocated on the heap, free this memory. */
 	if (buf != splitbuf) {
 		jas_free(buf);
 	}
-#endif
 }
 
 static void jpc_qmfb1d_join(jpc_fix_t *startptr, int startind, int endind,
@@ -286,12 +278,8 @@
   jpc_fix_t *hstartptr, int hstartind, int hendind)
 {
 	int bufsize = JPC_CEILDIVPOW2(endind - startind, 2);
-#if !defined(HAVE_VLA)
 #define	QMFB_JOINBUFSIZE	4096
 	jpc_fix_t joinbuf[QMFB_JOINBUFSIZE];
-#else
-	jpc_fix_t joinbuf[bufsize];
-#endif
 	jpc_fix_t *buf = joinbuf;
 	int llen;
 	int hlen;
@@ -303,7 +291,6 @@
 	register int n;
 	int state;
 
-#if !defined(HAVE_VLA)
 	/* Allocate memory for the join buffer from the heap. */
 	if (bufsize > QMFB_JOINBUFSIZE) {
 		if (!(buf = jas_alloc2(bufsize, sizeof(jpc_fix_t)))) {
@@ -314,7 +301,6 @@
 			return;
 		}
 	}
-#endif
 
 	twostep = step << 1;
 	llen = lendind - lstartind;
@@ -401,12 +387,10 @@
 		}
 	}
 
-#if !defined(HAVE_VLA)
 	/* If the join buffer was allocated on the heap, free this memory. */
 	if (buf != joinbuf) {
 		jas_free(buf);
 	}
-#endif
 }
 
 /******************************************************************************\