Hi,
since I need a working libtheora for some other ports I'm working on, I
had to investigate some issues with this library. The attached patch
explains (and fixes) these things.
Moritz
* Fix an out-of-bounds segfault, curtesy mmap()'ed malloc. Fixed by "manx"
on Freenode and committed upstream (will end up in alpha6 eventually)
This (path-lib_scan_c) makes encoding w/ Ogg Theora possible in the first
place on OpenBSD.
* Update to alpha5 while there, which contains additional bugfixes
* Allow alpha5 regression tests to work, and they pass on i386
* Nuke MODGNU_SHARED_LIBS
Tested on i386, dependencies do not complain.
diff -pruN --exclude=CVS /usr/ports/multimedia/libtheora/Makefile ./Makefile
--- /usr/ports/multimedia/libtheora/Makefile Fri Dec 30 09:10:38 2005
+++ ./Makefile Tue Mar 21 01:28:43 2006
@@ -1,11 +1,9 @@
# $OpenBSD: Makefile,v 1.3 2005/12/30 05:35:56 jakemsr Exp $
COMMENT= "open video codec"
-DISTNAME= libtheora-1.0alpha4
-PKGNAME= ${DISTNAME}p0
+DISTNAME= libtheora-1.0alpha5
CATEGORIES= multimedia
-SHARED_LIBS= theora 1.0
-MODGNU_SHARED_LIBS= theora ''
+SHARED_LIBS= theora 2.0
MASTER_SITES= http://downloads.xiph.org/releases/theora/
@@ -20,7 +18,6 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
BUILD_DEPENDS= :pkgconfig-*:devel/pkgconfig
-# uses Ogg headers
LIB_DEPENDS= ogg.5::audio/libogg
USE_LIBTOOL= Yes
diff -pruN --exclude=CVS /usr/ports/multimedia/libtheora/distinfo ./distinfo
--- /usr/ports/multimedia/libtheora/distinfo Sat Jul 9 02:35:02 2005
+++ ./distinfo Mon Mar 20 14:11:21 2006
@@ -1,4 +1,4 @@
-MD5 (libtheora-1.0alpha4.tar.gz) = 75f436a980b80f8b8102ee182ddb8748
-RMD160 (libtheora-1.0alpha4.tar.gz) = 1eca6dba519c8af94fa27c4112d3d3ec41aa54d3
-SHA1 (libtheora-1.0alpha4.tar.gz) = 524416a44bcc159bfe53893bb37983046b97522c
-SIZE (libtheora-1.0alpha4.tar.gz) = 2045695
+MD5 (libtheora-1.0alpha5.tar.gz) = 5add710b80b1cd8f3db9867d1fc9d151
+RMD160 (libtheora-1.0alpha5.tar.gz) = d6fa675176fc03523160bc2267ada7d2f8b0dab9
+SHA1 (libtheora-1.0alpha5.tar.gz) = 5e77de8ab428a203df4a680a078146429d190120
+SIZE (libtheora-1.0alpha5.tar.gz) = 1911650
diff -pruN --exclude=CVS
/usr/ports/multimedia/libtheora/patches/patch-Makefile_in
./patches/patch-Makefile_in
--- /usr/ports/multimedia/libtheora/patches/patch-Makefile_in Sat Jul 9
02:35:02 2005
+++ ./patches/patch-Makefile_in Tue Mar 21 01:14:50 2006
@@ -1,12 +1,12 @@
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2005/07/09 00:35:02 jolan Exp $
---- Makefile.in.orig Wed Dec 15 14:06:17 2004
-+++ Makefile.in Fri Jul 8 19:03:16 2005
-@@ -206,7 +206,7 @@ target_cpu = @target_cpu@
+--- Makefile.in.orig Sat Aug 20 21:30:42 2005
++++ Makefile.in Mon Mar 20 14:12:27 2006
+@@ -224,7 +224,7 @@ target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
AUTOMAKE_OPTIONS = foreign 1.6 dist-zip dist-bzip2
--SUBDIRS = lib include doc examples debian
-+SUBDIRS = lib include
+-SUBDIRS = lib include doc examples debian tests
++SUBDIRS = lib include tests
EXTRA_DIST = COPYING autogen.sh win32 libtheora.spec libtheora.spec.in \
theora-uninstalled.pc.in
diff -pruN --exclude=CVS
/usr/ports/multimedia/libtheora/patches/patch-configure
./patches/patch-configure
--- /usr/ports/multimedia/libtheora/patches/patch-configure Fri Dec 30
09:10:39 2005
+++ ./patches/patch-configure Thu Jan 1 01:00:00 1970
@@ -1,20 +0,0 @@
-$OpenBSD: patch-configure,v 1.2 2005/12/30 05:35:56 jakemsr Exp $
---- configure.orig Wed Dec 15 12:06:19 2004
-+++ configure Thu Dec 29 20:56:15 2005
-@@ -19863,6 +19863,7 @@ fi
-
- HAVE_VORBIS=no
-
-+if false ; then
-
- if test "x$HAVE_PKG_CONFIG" = "xyes"
- then
-@@ -20632,7 +20633,7 @@ echo "$as_me: WARNING: OSS audio support
- fi
-
- done
--
-+fi
-
- if test x$HAVE_SDL = xyes -a x$HAVE_OSS = xyes; then
- BUILDABLE_EXAMPLES="$BUILDABLE_EXAMPLES player_example"
diff -pruN --exclude=CVS
/usr/ports/multimedia/libtheora/patches/patch-lib_scan_c
./patches/patch-lib_scan_c
--- /usr/ports/multimedia/libtheora/patches/patch-lib_scan_c Thu Jan 1
01:00:00 1970
+++ ./patches/patch-lib_scan_c Tue Mar 21 01:03:37 2006
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- lib/scan.c.orig Sun Aug 14 19:55:58 2005
++++ lib/scan.c Mon Mar 20 23:53:23 2006
+@@ -1479,12 +1479,12 @@ static void PixelLineSearch( PP_INSTANCE
+ ogg_uint32_t * line_length ){
+ /* Exit if the pixel does not qualify or we have fallen off the edge
+ of either the image plane or the row. */
+- if ( ((*ChangedLocalsPtr) <= 1) ||
+- ((*ChangedLocalsPtr) >= 6) ||
+- (RowNumber < 0) ||
++ if ( (RowNumber < 0) ||
+ (RowNumber >= ppi->PlaneHeight) ||
+ (ColNumber < 0) ||
+- (ColNumber >= ppi->PlaneWidth) ){
++ (ColNumber >= ppi->PlaneWidth) ||
++ ((*ChangedLocalsPtr) <= 1) ||
++ ((*ChangedLocalsPtr) >= 6) ){
+ /* If not then it isn't part of any line. */
+ return;
+ }
diff -pruN --exclude=CVS
/usr/ports/multimedia/libtheora/patches/patch-tests_Makefile_in
./patches/patch-tests_Makefile_in
--- /usr/ports/multimedia/libtheora/patches/patch-tests_Makefile_in Thu Jan
1 01:00:00 1970
+++ ./patches/patch-tests_Makefile_in Tue Mar 21 01:21:30 2006
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- tests/Makefile.in.orig Tue Mar 21 01:19:39 2006
++++ tests/Makefile.in Tue Mar 21 01:21:24 2006
+@@ -218,7 +218,7 @@ target_alias = @target_alias@
+ target_cpu = @target_cpu@
+ target_os = @target_os@
+ target_vendor = @target_vendor@
+-INCLUDES = -I$(top_srcdir)/include
++INCLUDES = -I$(top_srcdir)/include $(OGG_CFLAGS)
+ noinst_HEADERS = tests.h
+ THEORADIR = ../lib
+ THEORA_LIBS = $(THEORADIR)/libtheora.la $(OGG_LIBS)