From nobody@FreeBSD.org  Thu Oct 24 10:30:40 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 35C85A6E
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Oct 2013 10:30:40 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 08F1F20D1
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Oct 2013 10:30:40 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r9OAUdm3020026
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 24 Oct 2013 10:30:39 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r9OAUdH9020004;
	Thu, 24 Oct 2013 10:30:39 GMT
	(envelope-from nobody)
Message-Id: <201310241030.r9OAUdH9020004@oldred.freebsd.org>
Date: Thu, 24 Oct 2013 10:30:39 GMT
From: Andriy Syrovenko <andriys@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: mediatomb crashes on video file scan.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         183269
>Category:       ports
>Synopsis:       mediatomb crashes on video file scan.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    wg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 24 10:40:00 UTC 2013
>Closed-Date:    Fri Oct 25 18:40:29 UTC 2013
>Last-Modified:  Fri Oct 25 18:50:00 UTC 2013
>Originator:     Andriy Syrovenko
>Release:        9.1-RELEASE-p7
>Organization:
>Environment:
FreeBSD fbsd01 9.1-RELEASE-p7 FreeBSD 9.1-RELEASE-p7 #0: Mon Sep  9 21:34:37 UTC 2013     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
After the recent update of multimedia/ffmpeg to v.2.0.1 mediatomb started crashing on any video file scan attempt.

Stack back trace shows avformat_open_input() on top. My investigation showed that avformat_open_input() expects either the AVFormatContext being pre-initialized or a pointer to it being set to NULL. Neither is currently the case in mediatomb.

>How-To-Repeat:
Start mediatomb and add some directory containing video files to scan.

>Fix:
The following patch fixed the problem for me:

Index: net/mediatomb/files/patch-livav9
===================================================================
--- net/mediatomb/files/patch-livav9	(revision 331419)
+++ net/mediatomb/files/patch-livav9	(working copy)
@@ -12,6 +12,15 @@
  		if (tag && tag->value && tag->value[0])
  		{
  			log_debug("Added metadata %s: %s\n", m->avname, tag->value);
+@@ -281,7 +281,7 @@
+     int x = 0;
+     int y = 0;
+
+-	AVFormatContext *pFormatCtx;
++	AVFormatContext *pFormatCtx = 0;
+ 	
+ 	// Suppress all log messages
+ 	av_log_set_callback(FfmpegNoOutputStub);
 @@ -290,14 +290,14 @@
      av_register_all();
  


Patch attached with submission follows:

Index: net/mediatomb/files/patch-livav9
===================================================================
--- net/mediatomb/files/patch-livav9	(revision 331419)
+++ net/mediatomb/files/patch-livav9	(working copy)
@@ -12,6 +12,15 @@
  		if (tag && tag->value && tag->value[0])
  		{
  			log_debug("Added metadata %s: %s\n", m->avname, tag->value);
+@@ -281,7 +281,7 @@
+     int x = 0;
+     int y = 0;
+
+-	AVFormatContext *pFormatCtx;
++	AVFormatContext *pFormatCtx = 0;
+ 	
+ 	// Suppress all log messages
+ 	av_log_set_callback(FfmpegNoOutputStub);
 @@ -290,14 +290,14 @@
      av_register_all();
  


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->wg 
Responsible-Changed-By: wg 
Responsible-Changed-When: Fri Oct 25 18:40:23 UTC 2013 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183269 
State-Changed-From-To: open->closed 
State-Changed-By: wg 
State-Changed-When: Fri Oct 25 18:40:29 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=183269 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/183269: commit references a PR
Date: Fri, 25 Oct 2013 18:40:18 +0000 (UTC)

 Author: wg
 Date: Fri Oct 25 18:40:10 2013
 New Revision: 331624
 URL: http://svnweb.freebsd.org/changeset/ports/331624
 
 Log:
   net/mediatomb: fix patch for ffmpeg2 support
   
   - Fix patch for ffmpeg2 support
   
   PR:		ports/183269
   Submitted by:	Andriy Syrovenko <andriys gmail.com>
 
 Modified:
   head/net/mediatomb/files/patch-livav9
 
 Modified: head/net/mediatomb/files/patch-livav9
 ==============================================================================
 --- head/net/mediatomb/files/patch-livav9	Fri Oct 25 18:38:03 2013	(r331623)
 +++ head/net/mediatomb/files/patch-livav9	Fri Oct 25 18:40:10 2013	(r331624)
 @@ -12,6 +12,15 @@ diff -burN mediatomb-0.12.1.old//src/met
   		if (tag && tag->value && tag->value[0])
   		{
   			log_debug("Added metadata %s: %s\n", m->avname, tag->value);
 +@@ -281,7 +281,7 @@
 +     int x = 0;
 +     int y = 0;
 +
 +-	AVFormatContext *pFormatCtx;
 ++	AVFormatContext *pFormatCtx = 0;
 + 	
 + 	// Suppress all log messages
 + 	av_log_set_callback(FfmpegNoOutputStub);
  @@ -290,14 +290,14 @@
       av_register_all();
   
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
