Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/libtheora/, media-libs/libtheora/files/
Date: Thu, 04 Oct 2018 00:01:32
Message-Id: 1538611277.92a952a998d41206b6af06fe2d9c3eb9ab2e3f4a.asturm@gentoo
1 commit: 92a952a998d41206b6af06fe2d9c3eb9ab2e3f4a
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 3 23:53:25 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 4 00:01:17 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92a952a9
7
8 media-libs/libtheora: Fix undefined behaviour, EAPI-7 bump
9
10 Thanks-to: <moatu <AT> opentrash.com>
11 Bug: https://bugs.gentoo.org/620800
12 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
13 Package-Manager: Portage-2.3.50, Repoman-2.3.11
14
15 .../files/libtheora-1.0_beta2-flags.patch | 4 +-
16 .../libtheora/files/libtheora-1.1.1-fix-UB.patch | 47 ++++++++++
17 .../libtheora/files/libtheora-1.1.1-libpng16.patch | 4 +-
18 .../files/libtheora-1.1.1-underlinking.patch | 4 +-
19 media-libs/libtheora/libtheora-1.1.1-r2.ebuild | 99 ++++++++++++++++++++++
20 5 files changed, 152 insertions(+), 6 deletions(-)
21
22 diff --git a/media-libs/libtheora/files/libtheora-1.0_beta2-flags.patch b/media-libs/libtheora/files/libtheora-1.0_beta2-flags.patch
23 index a47cc577168..ffc6ab5802a 100644
24 --- a/media-libs/libtheora/files/libtheora-1.0_beta2-flags.patch
25 +++ b/media-libs/libtheora/files/libtheora-1.0_beta2-flags.patch
26 @@ -1,6 +1,6 @@
27 diff -ur libtheora-1.0beta2.orig/configure.ac libtheora-1.0beta2/configure.ac
28 ---- libtheora-1.0beta2.orig/configure.ac 2007-10-13 00:01:38.000000000 +0300
29 -+++ libtheora-1.0beta2/configure.ac 2007-11-25 22:44:49.000000000 +0200
30 +--- a/configure.ac 2007-10-13 00:01:38.000000000 +0300
31 ++++ b/configure.ac 2007-11-25 22:44:49.000000000 +0200
32 @@ -102,8 +102,8 @@
33 case $host in
34 *)
35
36 diff --git a/media-libs/libtheora/files/libtheora-1.1.1-fix-UB.patch b/media-libs/libtheora/files/libtheora-1.1.1-fix-UB.patch
37 new file mode 100644
38 index 00000000000..862d6a3b816
39 --- /dev/null
40 +++ b/media-libs/libtheora/files/libtheora-1.1.1-fix-UB.patch
41 @@ -0,0 +1,47 @@
42 +From 0ae66d565e6bead8604d312bc1a4e9dccf245c88 Mon Sep 17 00:00:00 2001
43 +From: Tim Terriberry <tterribe@××××.org>
44 +Date: Tue, 8 May 2012 02:51:57 +0000
45 +Subject: [PATCH] Fix pp_sharp_mod calculation.
46 +
47 +This was broken when the dequant_tables indexing changed in commit
48 + r16102, but it only affected post-processing quality, so we never
49 + noticed.
50 +With gcc 4.8.0, this can now trigger a segfault during decoder
51 + initialization.
52 +
53 +svn path=/trunk/theora/; revision=18268
54 +---
55 + lib/decode.c | 8 ++++----
56 + 1 file changed, 4 insertions(+), 4 deletions(-)
57 +
58 +Note: The hunk header was modified from
59 +
60 + @@ -400,10 +400,10 @@
61 +
62 +to
63 +
64 + @@ -397,10 +397,10 @@
65 +
66 +to match the source code in the libtheora-1.1.1 tar-ball.
67 +
68 +diff --git a/lib/decode.c b/lib/decode.c
69 +index b803505..9f2516a 100644
70 +--- a/lib/decode.c
71 ++++ b/lib/decode.c
72 +@@ -397,10 +397,10 @@ static int oc_dec_init(oc_dec_ctx *_dec,const th_info *_info,
73 + int qsum;
74 + qsum=0;
75 + for(qti=0;qti<2;qti++)for(pli=0;pli<3;pli++){
76 +- qsum+=_dec->state.dequant_tables[qti][pli][qi][12]+
77 +- _dec->state.dequant_tables[qti][pli][qi][17]+
78 +- _dec->state.dequant_tables[qti][pli][qi][18]+
79 +- _dec->state.dequant_tables[qti][pli][qi][24]<<(pli==0);
80 ++ qsum+=_dec->state.dequant_tables[qi][pli][qti][12]+
81 ++ _dec->state.dequant_tables[qi][pli][qti][17]+
82 ++ _dec->state.dequant_tables[qi][pli][qti][18]+
83 ++ _dec->state.dequant_tables[qi][pli][qti][24]<<(pli==0);
84 + }
85 + _dec->pp_sharp_mod[qi]=-(qsum>>11);
86 + }
87 +--
88 +2.10.2
89
90 diff --git a/media-libs/libtheora/files/libtheora-1.1.1-libpng16.patch b/media-libs/libtheora/files/libtheora-1.1.1-libpng16.patch
91 index 93da700c4d7..46d93332390 100644
92 --- a/media-libs/libtheora/files/libtheora-1.1.1-libpng16.patch
93 +++ b/media-libs/libtheora/files/libtheora-1.1.1-libpng16.patch
94 @@ -1,8 +1,8 @@
95 http://bugs.gentoo.org/465450
96 http://trac.xiph.org/ticket/1947
97
98 ---- examples/png2theora.c
99 -+++ examples/png2theora.c
100 +--- a/examples/png2theora.c
101 ++++ b/examples/png2theora.c
102 @@ -462,9 +462,9 @@
103 png_set_strip_alpha(png_ptr);
104
105
106 diff --git a/media-libs/libtheora/files/libtheora-1.1.1-underlinking.patch b/media-libs/libtheora/files/libtheora-1.1.1-underlinking.patch
107 index b45a368ebd7..7836e3abda2 100644
108 --- a/media-libs/libtheora/files/libtheora-1.1.1-underlinking.patch
109 +++ b/media-libs/libtheora/files/libtheora-1.1.1-underlinking.patch
110 @@ -1,7 +1,7 @@
111 http://bugs.gentoo.org/504270
112
113 ---- examples/Makefile.am
114 -+++ examples/Makefile.am
115 +--- a/examples/Makefile.am
116 ++++ b/examples/Makefile.am
117 @@ -22,7 +22,7 @@
118
119 player_example_SOURCES = player_example.c
120
121 diff --git a/media-libs/libtheora/libtheora-1.1.1-r2.ebuild b/media-libs/libtheora/libtheora-1.1.1-r2.ebuild
122 new file mode 100644
123 index 00000000000..43080a81d96
124 --- /dev/null
125 +++ b/media-libs/libtheora/libtheora-1.1.1-r2.ebuild
126 @@ -0,0 +1,99 @@
127 +# Copyright 1999-2018 Gentoo Authors
128 +# Distributed under the terms of the GNU General Public License v2
129 +
130 +EAPI=7
131 +
132 +inherit autotools flag-o-matic multilib-minimal
133 +
134 +DESCRIPTION="The Theora Video Compression Codec"
135 +HOMEPAGE="https://www.theora.org"
136 +SRC_URI="https://downloads.xiph.org/releases/theora/${P/_}.tar.bz2"
137 +
138 +LICENSE="BSD"
139 +SLOT="0"
140 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
141 +IUSE="doc +encode examples static-libs"
142 +
143 +REQUIRED_USE="examples? ( encode )" #285895
144 +
145 +RDEPEND="
146 + >=media-libs/libogg-1.3.0:=[${MULTILIB_USEDEP}]
147 + encode? ( >=media-libs/libvorbis-1.3.3-r1:=[${MULTILIB_USEDEP}] )
148 + examples? (
149 + media-libs/libpng:0=
150 + >=media-libs/libsdl-0.11.0
151 + media-libs/libvorbis:=
152 + )"
153 +DEPEND="${RDEPEND}"
154 +BDEPEND="
155 + doc? ( app-doc/doxygen )
156 + virtual/pkgconfig"
157 +
158 +S=${WORKDIR}/${P/_}
159 +
160 +VARTEXFONTS=${T}/fonts
161 +
162 +DOCS=( AUTHORS CHANGES README )
163 +
164 +PATCHES=(
165 + "${FILESDIR}"/${PN}-1.0_beta2-flags.patch
166 + "${FILESDIR}"/${P}-underlinking.patch
167 + "${FILESDIR}"/${P}-libpng16.patch # bug 465450
168 + "${FILESDIR}"/${P}-fix-UB.patch # bug 620800
169 +)
170 +
171 +src_prepare() {
172 + default
173 +
174 + # bug 467006
175 + sed -i "s/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/" configure.ac || die
176 +
177 + AT_M4DIR=m4 eautoreconf
178 +}
179 +
180 +multilib_src_configure() {
181 + use x86 && filter-flags -fforce-addr -frename-registers #200549
182 + use doc || export ac_cv_prog_HAVE_DOXYGEN=false
183 +
184 + local myconf=(
185 + --disable-spec
186 + $(use_enable encode)
187 + $(use_enable static-libs static)
188 + )
189 +
190 + if [[ "${ABI}" = "${DEFAULT_ABI}" ]] ; then
191 + myconf+=( $(use_enable examples) )
192 + else
193 + # those will be overwritten anyway
194 + myconf+=( --disable-examples )
195 + fi
196 +
197 + # --disable-spec because LaTeX documentation has been prebuilt
198 + ECONF_SOURCE="${S}" econf "${myconf[@]}"
199 +}
200 +
201 +multilib_src_install() {
202 + emake \
203 + DESTDIR="${D}" \
204 + docdir="${EPREFIX}"/usr/share/doc/${PF} \
205 + install
206 +
207 + if use examples && [[] "${ABI}" = "${DEFAULT_ABI}" ]]; then
208 + dobin examples/.libs/png2theora
209 + for bin in dump_{psnr,video} {encoder,player}_example; do
210 + newbin examples/.libs/${bin} theora_${bin}
211 + done
212 + fi
213 +}
214 +
215 +multilib_src_install_all() {
216 + find "${D}" -name '*.la' -delete || die
217 + einstalldocs
218 +
219 + if use examples && use doc; then
220 + docinto examples
221 + dodoc examples/*.[ch]
222 + docompress -x /usr/share/doc/${PF}/examples
223 + docinto .
224 + fi
225 +}