Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jun 2008 15:35:22 GMT
From:      Fabian Keil <fk@fabiankeil.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/124616: [PATCH] Prevent audio/mp3splt from segfaulting if vorbis file is split after mp3 file
Message-ID:  <200806151535.m5FFZMS0036240@www.freebsd.org>
Resent-Message-ID: <200806151540.m5FFe0Ch077757@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         124616
>Category:       ports
>Synopsis:       [PATCH] Prevent audio/mp3splt from segfaulting if vorbis file is split after mp3 file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 15 15:40:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Fabian Keil
>Release:        CURRENT
>Organization:
>Environment:
FreeBSD TP51.local 8.0-CURRENT FreeBSD 8.0-CURRENT #22: Wed Jun 11 18:12:28 CEST 2008     fk@TP51.local:/usr/obj/usr/src/sys/THINKPAD  i386
>Description:
audio/mp3splt segfaults if a vorbis file is split
after a mp3 file. The attached patch prevents that.

I already reported the problem upstream:
https://sourceforge.net/tracker/?func=detail&atid=476061&aid=1953386&group_id=55130
but it seems that they are busy rewriting mp3splt,
thus the old one is no longer actively maintained
and waiting for a new release may take a while.
>How-To-Repeat:
fk@TP51 /tank/iriver-spiegel/podcasts/split $mp3splt -t 5.00 ../bsdtalk14*
Mp3Splt 2.1c (2005/Apr/03) by Matteo Trotta <matteo.trotta@lib.unimib.it>
THIS SOFTWARE COMES WITH ABSOLUTELY NO WARRANTY! USE AT YOUR OWN RISK!
./bsdtalk143.mp3:
MPEG 1 Layer 3 - 44100 Hz - Mono - 64 Kb/s - Total time: 22m.45s
Splitting bsdtalk143_000.00_005.00.mp3... OK
[...]
Splitting bsdtalk143_020.00_025.00.mp3... OK (WARNING)
Warning: mp3 might be VBR. You should use -f option.
./bsdtalk143.ogg:
Ogg Vorbis Stream - 44100 - 93 Kb/s - 1 channels - Total time: 22m.45s
Splitting bsdtalk143_000.00_005.00.ogg... OK
[...]
Splitting bsdtalk143_020.00_025.00.ogg... OK (EOF)
./bsdtalk144.mp3:
Segmentation fault: 11 (core dumped)
>Fix:


Patch attached with submission follows:

diff -u -ruN mp3splt.orig/Makefile mp3splt/Makefile
--- mp3splt.orig/Makefile	2008-02-07 16:09:10.100268000 +0100
+++ mp3splt/Makefile	2008-06-15 16:52:12.058673649 +0200
@@ -7,7 +7,7 @@
 
 PORTNAME=	mp3splt
 PORTVERSION=	2.1c
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	audio
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
diff -u -ruN mp3splt.orig/files/patch-mp3splt.c mp3splt/files/patch-mp3splt.c
--- mp3splt.orig/files/patch-mp3splt.c	1970-01-01 01:00:00.000000000 +0100
+++ mp3splt/files/patch-mp3splt.c	2008-04-27 21:07:59.025871032 +0200
@@ -0,0 +1,16 @@
+--- mp3splt.c.orig	2005-03-26 14:51:56.000000000 +0100
++++ mp3splt.c	2008-04-27 21:05:45.396787349 +0200
+@@ -114,6 +114,13 @@
+ 		if (state->mstate) {
+ 			fclose(state->mstate->file_input);
+ 			mp3_state_free(state->mstate);
++                        /*
++                         * Explicitly setting mstate to NULL
++                         * prevents encoding misdetection (resulting
++                         * in a crash) if a mp3 file is followed by
++                         * a vorbis file.
++                         */
++                        state->mstate = NULL;
+ 		}
+ #ifndef NO_OGG
+ 		else if (state->ostate) { // If file has been opened with ov_open we should close it using ov_clear()


>Release-Note:
>Audit-Trail:
>Unformatted:



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