View | Details | Raw Unified | Return to bug 262874 | Differences between
and this patch

Collapse All | Expand All

(-)b/audio/libmad/Makefile (-20 / +10 lines)
Lines 1-35 Link Here
1
# Created by: Sergey Akifyev <asa@gascom.ru>
1
# Created by: Sergey Akifyev <asa@gascom.ru>
2
2
3
PORTNAME=	libmad
3
PORTNAME=	libmad
4
PORTVERSION=	0.15.1b
4
DISTVERSION=	0.16.0
5
PORTREVISION=	7
6
CATEGORIES=	audio
5
CATEGORIES=	audio
7
MASTER_SITES=	SF/mad/${PORTNAME}/${PORTVERSION}
6
7
PATCH_SITES=	https://github.com/diizzyy/libmad/commit/
8
PATCHFILES=	c2eb5e1a728c973ea3f957d4cb6e04d77f745568.patch:-p1 \
9
		a8ca654e3666f442805d93722290bb218b633428.patch:-p1
8
10
9
MAINTAINER=	sunpoet@FreeBSD.org
11
MAINTAINER=	sunpoet@FreeBSD.org
10
COMMENT=	Libmad library (part of MAD project)
12
COMMENT=	Libmad library (part of MAD project)
11
13
12
LICENSE=	GPLv2
14
LICENSE=	GPLv2
13
15
14
USES=		cpe libtool
16
USES=		cmake cpe pathfix
15
16
CONFIGURE_ARGS=	--disable-debugging --enable-sso
17
GNU_CONFIGURE=	yes
18
INSTALL_TARGET=	install-strip
19
USE_LDCONFIG=	yes
20
21
SUB_LIST=	VERSION=${PORTVERSION}
22
SUB_FILES=	mad.pc
23
24
CPE_VENDOR=	underbit
17
CPE_VENDOR=	underbit
25
18
26
OPTIONS_DEFINE=	SPEED
19
USE_GITHUB=	yes
27
SPEED_DESC=	Optimize for speed over accuracy
20
GH_ACCOUNT=	tenacityteam
28
21
GH_TAGNAME=	15d1ef05
29
SPEED_CONFIGURE_ON=	--enable-speed
30
SPEED_CONFIGURE_OFF=	--enable-accuracy
31
22
32
post-install:
23
USE_LDCONFIG=	yes
33
	${INSTALL_DATA} ${WRKDIR}/mad.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig/
34
24
35
.include <bsd.port.mk>
25
.include <bsd.port.mk>
(-)b/audio/libmad/distinfo (-2 / +7 lines)
Lines 1-2 Link Here
1
SHA256 (libmad-0.15.1b.tar.gz) = bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690
1
TIMESTAMP = 1648676242
2
SIZE (libmad-0.15.1b.tar.gz) = 502379
2
SHA256 (tenacityteam-libmad-0.16.0-15d1ef05_GH0.tar.gz) = e380ee75784732cbf619c44df10418d652a30134f24e40b41d44b59b0a9f5579
3
SIZE (tenacityteam-libmad-0.16.0-15d1ef05_GH0.tar.gz) = 213534
4
SHA256 (c2eb5e1a728c973ea3f957d4cb6e04d77f745568.patch) = 6bc3b4656686801cbc526554226594361ddf97a6334eaadcb4765efd1c0ed916
5
SIZE (c2eb5e1a728c973ea3f957d4cb6e04d77f745568.patch) = 972
6
SHA256 (a8ca654e3666f442805d93722290bb218b633428.patch) = c15bf57d20090bd13a1749454ca987f47262136c4ae4781914062247b376a7df
7
SIZE (a8ca654e3666f442805d93722290bb218b633428.patch) = 814
(-)a/audio/libmad/files/mad.pc.in (-11 lines)
Removed Link Here
1
prefix=%%PREFIX%%
2
exec_prefix=${prefix}
3
libdir=${exec_prefix}/lib
4
includedir=${prefix}/include
5
6
Name: mad
7
Description: MPEG Audio Decoder
8
Requires:
9
Version: %%VERSION%%
10
Libs: -L${libdir} -lmad -lm
11
Cflags: -I${includedir}
(-)a/audio/libmad/files/patch-configure (-40 lines)
Removed Link Here
1
--- configure.orig	2004-02-05 09:34:07 UTC
2
+++ configure
3
@@ -19096,24 +19096,30 @@ then
4
 	esac
5
     fi
6
 
7
+    if $CC -v 2>&1 | grep clang > /dev/null; then
8
+	CLANG=yes
9
+    else
10
+	CLANG=no
11
+    fi
12
+
13
     case "$optimize" in
14
 	-O|"-O "*)
15
 	    optimize="-O"
16
-	    optimize="$optimize -fforce-mem"
17
-	    optimize="$optimize -fforce-addr"
18
+	    optimize="$optimize"
19
+	    test $CLANG = no && optimize="$optimize -fforce-addr"
20
 	    : #x optimize="$optimize -finline-functions"
21
 	    : #- optimize="$optimize -fstrength-reduce"
22
-	    optimize="$optimize -fthread-jumps"
23
-	    optimize="$optimize -fcse-follow-jumps"
24
-	    optimize="$optimize -fcse-skip-blocks"
25
+	    test $CLANG = no && optimize="$optimize -fthread-jumps"
26
+	    test $CLANG = no && optimize="$optimize -fcse-follow-jumps"
27
+	    test $CLANG = no && optimize="$optimize -fcse-skip-blocks"
28
 	    : #x optimize="$optimize -frerun-cse-after-loop"
29
 	    : #x optimize="$optimize -frerun-loop-opt"
30
 	    : #x optimize="$optimize -fgcse"
31
 	    optimize="$optimize -fexpensive-optimizations"
32
-	    optimize="$optimize -fregmove"
33
+	    test $CLANG = no && optimize="$optimize -fregmove"
34
 	    : #* optimize="$optimize -fdelayed-branch"
35
 	    : #x optimize="$optimize -fschedule-insns"
36
-	    optimize="$optimize -fschedule-insns2"
37
+	    test $CLANG = no && optimize="$optimize -fschedule-insns2"
38
 	    : #? optimize="$optimize -ffunction-sections"
39
 	    : #? optimize="$optimize -fcaller-saves"
40
 	    : #> optimize="$optimize -funroll-loops"
(-)a/audio/libmad/files/patch-layer12.c (-175 lines)
Removed Link Here
1
Obtained from:	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508133#15
2
3
--- layer12.c.orig	2004-02-05 09:02:39 UTC
4
+++ layer12.c
5
@@ -134,6 +134,12 @@ int mad_layer_I(struct mad_stream *strea
6
   for (sb = 0; sb < bound; ++sb) {
7
     for (ch = 0; ch < nch; ++ch) {
8
       nb = mad_bit_read(&stream->ptr, 4);
9
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
10
+	{
11
+		stream->error = MAD_ERROR_LOSTSYNC;
12
+		stream->sync = 0;
13
+		return -1;
14
+	}
15
 
16
       if (nb == 15) {
17
 	stream->error = MAD_ERROR_BADBITALLOC;
18
@@ -146,6 +152,12 @@ int mad_layer_I(struct mad_stream *strea
19
 
20
   for (sb = bound; sb < 32; ++sb) {
21
     nb = mad_bit_read(&stream->ptr, 4);
22
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
23
+	{
24
+		stream->error = MAD_ERROR_LOSTSYNC;
25
+		stream->sync = 0;
26
+		return -1;
27
+	}
28
 
29
     if (nb == 15) {
30
       stream->error = MAD_ERROR_BADBITALLOC;
31
@@ -162,6 +174,12 @@ int mad_layer_I(struct mad_stream *strea
32
     for (ch = 0; ch < nch; ++ch) {
33
       if (allocation[ch][sb]) {
34
 	scalefactor[ch][sb] = mad_bit_read(&stream->ptr, 6);
35
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
36
+	{
37
+		stream->error = MAD_ERROR_LOSTSYNC;
38
+		stream->sync = 0;
39
+		return -1;
40
+	}
41
 
42
 # if defined(OPT_STRICT)
43
 	/*
44
@@ -187,6 +205,12 @@ int mad_layer_I(struct mad_stream *strea
45
 	frame->sbsample[ch][s][sb] = nb ?
46
 	  mad_f_mul(I_sample(&stream->ptr, nb),
47
 		    sf_table[scalefactor[ch][sb]]) : 0;
48
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
49
+	{
50
+		stream->error = MAD_ERROR_LOSTSYNC;
51
+		stream->sync = 0;
52
+		return -1;
53
+	}
54
       }
55
     }
56
 
57
@@ -195,6 +219,12 @@ int mad_layer_I(struct mad_stream *strea
58
 	mad_fixed_t sample;
59
 
60
 	sample = I_sample(&stream->ptr, nb);
61
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
62
+	{
63
+		stream->error = MAD_ERROR_LOSTSYNC;
64
+		stream->sync = 0;
65
+		return -1;
66
+	}
67
 
68
 	for (ch = 0; ch < nch; ++ch) {
69
 	  frame->sbsample[ch][s][sb] =
70
@@ -403,7 +433,15 @@ int mad_layer_II(struct mad_stream *stre
71
     nbal = bitalloc_table[offsets[sb]].nbal;
72
 
73
     for (ch = 0; ch < nch; ++ch)
74
+    {
75
       allocation[ch][sb] = mad_bit_read(&stream->ptr, nbal);
76
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
77
+	{
78
+		stream->error = MAD_ERROR_LOSTSYNC;
79
+		stream->sync = 0;
80
+		return -1;
81
+	}
82
+    }
83
   }
84
 
85
   for (sb = bound; sb < sblimit; ++sb) {
86
@@ -411,6 +449,13 @@ int mad_layer_II(struct mad_stream *stre
87
 
88
     allocation[0][sb] =
89
     allocation[1][sb] = mad_bit_read(&stream->ptr, nbal);
90
+
91
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
92
+	{
93
+		stream->error = MAD_ERROR_LOSTSYNC;
94
+		stream->sync = 0;
95
+		return -1;
96
+	}
97
   }
98
 
99
   /* decode scalefactor selection info */
100
@@ -419,6 +464,12 @@ int mad_layer_II(struct mad_stream *stre
101
     for (ch = 0; ch < nch; ++ch) {
102
       if (allocation[ch][sb])
103
 	scfsi[ch][sb] = mad_bit_read(&stream->ptr, 2);
104
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
105
+	{
106
+		stream->error = MAD_ERROR_LOSTSYNC;
107
+		stream->sync = 0;
108
+		return -1;
109
+	}
110
     }
111
   }
112
 
113
@@ -442,6 +493,12 @@ int mad_layer_II(struct mad_stream *stre
114
     for (ch = 0; ch < nch; ++ch) {
115
       if (allocation[ch][sb]) {
116
 	scalefactor[ch][sb][0] = mad_bit_read(&stream->ptr, 6);
117
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
118
+	{
119
+		stream->error = MAD_ERROR_LOSTSYNC;
120
+		stream->sync = 0;
121
+		return -1;
122
+	}
123
 
124
 	switch (scfsi[ch][sb]) {
125
 	case 2:
126
@@ -452,11 +509,23 @@ int mad_layer_II(struct mad_stream *stre
127
 
128
 	case 0:
129
 	  scalefactor[ch][sb][1] = mad_bit_read(&stream->ptr, 6);
130
+		if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
131
+		{
132
+			stream->error = MAD_ERROR_LOSTSYNC;
133
+			stream->sync = 0;
134
+			return -1;
135
+		}
136
 	  /* fall through */
137
 
138
 	case 1:
139
 	case 3:
140
 	  scalefactor[ch][sb][2] = mad_bit_read(&stream->ptr, 6);
141
+		if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
142
+		{
143
+			stream->error = MAD_ERROR_LOSTSYNC;
144
+			stream->sync = 0;
145
+			return -1;
146
+		}
147
 	}
148
 
149
 	if (scfsi[ch][sb] & 1)
150
@@ -488,6 +557,12 @@ int mad_layer_II(struct mad_stream *stre
151
 	  index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
152
 
153
 	  II_samples(&stream->ptr, &qc_table[index], samples);
154
+		if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
155
+		{
156
+			stream->error = MAD_ERROR_LOSTSYNC;
157
+			stream->sync = 0;
158
+			return -1;
159
+		}
160
 
161
 	  for (s = 0; s < 3; ++s) {
162
 	    frame->sbsample[ch][3 * gr + s][sb] =
163
@@ -506,6 +581,12 @@ int mad_layer_II(struct mad_stream *stre
164
 	index = offset_table[bitalloc_table[offsets[sb]].offset][index - 1];
165
 
166
 	II_samples(&stream->ptr, &qc_table[index], samples);
167
+	if (mad_bit_nextbyte(&stream->ptr) > stream->next_frame)
168
+	{
169
+		stream->error = MAD_ERROR_LOSTSYNC;
170
+		stream->sync = 0;
171
+		return -1;
172
+	}
173
 
174
 	for (ch = 0; ch < nch; ++ch) {
175
 	  for (s = 0; s < 3; ++s) {
(-)a/audio/libmad/files/patch-layer3.c (-17 lines)
Removed Link Here
1
Obtained from:	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508133#15
2
3
--- layer3.c.orig	2004-01-23 09:41:32 UTC
4
+++ layer3.c
5
@@ -2608,6 +2608,12 @@ int mad_layer_III(struct mad_stream *str
6
     next_md_begin = 0;
7
 
8
   md_len = si.main_data_begin + frame_space - next_md_begin;
9
+  if (md_len + MAD_BUFFER_GUARD > MAD_BUFFER_MDLEN)
10
+  {
11
+	stream->error = MAD_ERROR_LOSTSYNC;
12
+	stream->sync = 0;
13
+	return -1;
14
+  }
15
 
16
   frame_used = 0;
17
 
(-)b/audio/libmad/pkg-plist (-4 / +6 lines)
Lines 1-6 Link Here
1
include/mad.h
1
include/mad.h
2
lib/libmad.a
2
lib/cmake/mad/madConfig.cmake
3
lib/cmake/mad/madConfigVersion.cmake
4
lib/cmake/mad/madTargets-%%CMAKE_BUILD_TYPE%%.cmake
5
lib/cmake/mad/madTargets.cmake
3
lib/libmad.so
6
lib/libmad.so
4
lib/libmad.so.0
7
lib/libmad.so.0.16.0
5
lib/libmad.so.0.2.1
8
libdata/pkgconfig/libmad.pc
6
libdata/pkgconfig/mad.pc

Return to bug 262874