Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Aug 2012 12:40:30 +0000 (UTC)
From:      Ganael LAPLANCHE <martymac@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r301826 - in head/multimedia/libdvdnav: . files
Message-ID:  <201208011240.q71CeUFg054568@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: martymac
Date: Wed Aug  1 12:40:29 2012
New Revision: 301826
URL: http://svn.freebsd.org/changeset/ports/301826

Log:
  - Add DEBUG option [1]
  - Fix crash with some discs [1]
  - Un-version LIB_DEPENDS
  
  PR:	ports/169698 [1]
  Submitted by:	Fabian Keil <fk@fabiankeil.de> [1]

Added:
  head/multimedia/libdvdnav/files/patch-src-searching.c   (contents, props changed)
Modified:
  head/multimedia/libdvdnav/Makefile   (contents, props changed)

Modified: head/multimedia/libdvdnav/Makefile
==============================================================================
--- head/multimedia/libdvdnav/Makefile	Wed Aug  1 12:26:01 2012	(r301825)
+++ head/multimedia/libdvdnav/Makefile	Wed Aug  1 12:40:29 2012	(r301826)
@@ -7,6 +7,7 @@
 
 PORTNAME=	libdvdnav
 PORTVERSION=	4.2.0
+PORTREVISION=	1
 CATEGORIES=	multimedia
 # Svn repository URL : svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav
 MASTER_SITES=	http://dvdnav.mplayerhq.hu/releases/ \
@@ -18,7 +19,7 @@ COMMENT=	MPlayer version of the libdvdna
 
 LICENSE=	GPLv2
 
-LIB_DEPENDS=	dvdread.4:${PORTSDIR}/multimedia/libdvdread
+LIB_DEPENDS=	dvdread:${PORTSDIR}/multimedia/libdvdread
 
 USE_BZIP2=	yes
 HAS_CONFIGURE=	yes
@@ -29,14 +30,23 @@ CONFIGURE_ARGS=	--prefix="${PREFIX}" \
 		--shlibdir="${PREFIX}/lib" \
 		--incdir="${PREFIX}/include/dvdnav" \
 		--disable-opts \
-		--disable-debug \
 		--cc="${CC}"
 USE_GMAKE=	yes
 CONFLICTS=	libdvdnav-mplayer-[0-9]*
 USE_LDCONFIG=	yes
 
+OPTIONS_DEFINE=	DEBUG
+
+.include <bsd.port.pre.mk>
+
+.if ${PORT_OPTIONS:MDEBUG}
+CONFIGURE_ARGS+=	--enable-debug --disable-strip
+.else
+CONFIGURE_ARGS+=	--disable-debug
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's|^threadlib="-lpthread"|threadlib="${PTHREAD_LIBS}"|g' \
 		${WRKSRC}/configure2
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>

Added: head/multimedia/libdvdnav/files/patch-src-searching.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/libdvdnav/files/patch-src-searching.c	Wed Aug  1 12:40:29 2012	(r301826)
@@ -0,0 +1,43 @@
+From 49c67ccf88c688e0e0e9e3b04f651b12c7d7f7f3 Mon Sep 17 00:00:00 2001
+From: Erik Hovland <erik@hovland.org>
+Date: Mon, 16 Apr 2012 14:56:43 -0700
+Subject: [PATCH] Check cell new row before using it to index into
+ cell_playback
+
+cellnr is used to index into cell_playback after subtracting
+one from it. If cellnr is 0, then it will index -1 in cell_playback
+which will seek out of boundary of cell_playback. This manifested into a
+segfault for some users as reported by this launchpad bug:
+https://bugs.launchpad.net/ubuntu/+source/libdvdnav/+bug/934471
+
+By checking cellnr and skipping the indexing if cellnr is equal to zero
+then we avoid the segfault. There might be a bigger issue w/ regard to
+retrieving a value of zero for cell new row, but this fix works for the
+reporter.
+
+Thanks goes to Sylvain Henry (hsyl20 AT gmail DOT com for both
+reporting the bug to launchpad and submitting a potential patch (even
+though we went w/ a different fix).
+---
+ src/searching.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/searching.c b/src/searching.c
+index 3649e9d..0b5f22a 100644
+--- src/searching.c
++++ src/searching.c
+@@ -640,7 +640,11 @@ uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t
+       goto fail;
+     }
+ 
+-    cellnr = pgc->program_map[ptt[i].pgn-1];
++    if ((cellnr = pgc->program_map[ptt[i].pgn-1]) == 0) {
++      printerr("Cell new row cannot be 0");
++      continue;
++    }
++
+     if(ptt[i].pgn < pgc->nr_of_programs)
+       endcellnr = pgc->program_map[ptt[i].pgn];
+     else
+-- 
+1.7.10.3



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208011240.q71CeUFg054568>