Bug 29511

Summary: crash in ffmpeg metadata handler
Product: Sisyphus Reporter: Konstantin A Lepikhov (L.A. Kostis) <lakostis>
Component: mediatombAssignee: Sergey Bolshakov <sbolshakov>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: critical    
Priority: P3 Keywords: relnote
Version: unstable   
Hardware: all   
OS: Linux   
URL: https://bugs.gentoo.org/attachment.cgi?id=333734&action=diff
Attachments:
Description Flags
Fix from upstream none

Description Konstantin A Lepikhov (L.A. Kostis) 2013-10-22 23:58:08 MSK
Created attachment 5977 [details]
Fix from upstream

Reproducible: Always

Steps to Reproduce:
1.Update to latest version from Sisyphus
2.Start the daemon
3.wait a couple of seconds for segfault (or if no DB, go to the web interface and add some files, then wait for segfault)
Actual Results:  
Segfault with the following in syslog:

kernel: mediatomb[10301]: segfault at 25 ip b724bab7 sp b12d0af0 error 4 in libavformat.so.53.32.100[b71a1000+d3000]

It seems that initializing the pointer does the trick:

--- a/src/metadata/ffmpeg_handler.cc
+++ b/src/metadata/ffmpeg_handler.cc
@@ -259,7 +259,7 @@ void FfmpegHandler::fillMetadata(Ref<CdsItem> item)
     int x = 0;
     int y = 0;
 
-       AVFormatContext *pFormatCtx;
+       AVFormatContext *pFormatCtx = NULL;
 
        // Suppress all log messages
        av_log_set_callback(FfmpegNoOutputStub);
Comment 1 Repository Robot 2013-10-24 14:46:23 MSK
mediatomb-0.12.1-alt11 -> sisyphus:

* Thu Oct 24 2013 Sergey Bolshakov <sbolshakov@altlinux> 0.12.1-alt11
- fixed segfault in metadata scanner (closes: #29511)