Bug 3401

Summary: vlc on any .flv file immediately segfaults (with patch!)
Product: Fedora Reporter: Richard W.M. Jones <rjones>
Component: vlcAssignee: Nicolas Chauvet <kwizart>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P5    
Version: 21   
Hardware: All   
OS: GNU/Linux   
namespace:

Description Richard W.M. Jones 2014-11-05 18:21:33 CET
Grab any .flv file, and do:

  $ vlc foo.flv

The program will immediately segfault with this stack trace:

#0  0x00007f199c0f9464 in strlen () at /lib64/libc.so.6
#1  0x00007f1964e062cf in av_match_name () at /lib64/libavutil.so.54
#2  0x00007f19661493ae in av_probe_input_format3 () at /lib64/libavformat.so.56
#3  0x00007f1966149532 in av_probe_input_format2 () at /lib64/libavformat.so.56
#4  0x00007f1966149596 in av_probe_input_format () at /lib64/libavformat.so.56
#5  0x00007f196648b4af in OpenDemux ()
    at /usr/lib64/vlc/plugins/demux/libavformat_plugin.so
#6  0x00007f199d021de5 in module_load () at /lib64/libvlccore.so.7
#7  0x00007f199d02239e in vlc_module_load () at /lib64/libvlccore.so.7
#8  0x00007f199cfe0b10 in demux_New () at /lib64/libvlccore.so.7
#9  0x00007f199cfede51 in InputSourceInit () at /lib64/libvlccore.so.7
#10 0x00007f199cfeed3b in Init () at /lib64/libvlccore.so.7
#11 0x00007f199cff0470 in input_Preparse () at /lib64/libvlccore.so.7
#12 0x00007f199cfd02e0 in Thread () at /lib64/libvlccore.so.7
#13 0x00007f199c63652a in start_thread () at /lib64/libpthread.so.0
#14 0x00007f199c16e77d in clone () at /lib64/libc.so.6

I applied the following patch to my copy of vlc and recompiled it,
and this fixes the bug:

--- a/modules/demux/avformat/demux.c	2013-12-03 10:12:34.000000000 +0100
+++ b/modules/demux/avformat/demux.c	2014-10-12 22:07:54.044769366 +0200
@@ -106,7 +106,7 @@ int OpenDemux( vlc_object_t *p_this )
 {
     demux_t       *p_demux = (demux_t*)p_this;
     demux_sys_t   *p_sys;
-    AVProbeData   pd;
+    AVProbeData   pd = {0};
     AVInputFormat *fmt = NULL;
     unsigned int  i;
     int64_t       i_start_time = -1;

Note the patch is not mine, it's from:

https://bugs.archlinux.org/task/42099#comment128570

and AFAIK the patch is not upstream.
Comment 1 Richard W.M. Jones 2014-11-05 18:21:59 CET
I forgot to say that this bug affects vlc-2.1.5-5.fc21.x86_64
Comment 2 Nicolas Chauvet 2014-11-05 21:17:10 CET
(In reply to comment #1)
> I forgot to say that this bug affects vlc-2.1.5-5.fc21.x86_64

It probably means that ffmpeg-2.4 is better tested upstream with vlc-2.2 over 2.1. I prefer to move forward than keeping this "old" vlc release.
Comment 3 Nicolas Chauvet 2014-11-06 15:07:55 CET
Patch applied, will be made available on the next push.
I will update to vlc 2.2.x before GA.