[MPlayer-dev-eng] [PATCH] Segmentation fault in tv demuxer when specified video device doesn't exist

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Thu Nov 9 23:07:20 CET 2006


(gdb) run -v tv:// -tv driver=v4l2:device=/dev/video1 -vo x11
Starting program: /home/dominik/build/BUILD/MPlayer-20771/mplayer -v tv:// -tv driver=v4l2:device=/dev/video1 -vo x11
[Thread debugging using libthread_db enabled]
[New Thread 46912496243952 (LWP 16457)]
MPlayer dev-Fedora-GS-SVN-r20771-4.1.1 (C) 2000-2006 MPlayer Team
CPU: AMD Sempron(tm) Processor 3000+ (Family: 15, Model: 47, Stepping: 2)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2
get_path('codecs.conf') -> '/home/dominik/.mplayer/codecs.conf'
Reading /home/dominik/.mplayer/codecs.conf: Can't open '/home/dominik/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/codecs.conf: Can't open '/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf.
CommandLine: '-v' 'tv://' '-tv' 'driver=v4l2:device=/dev/video1' '-vo' 'x11'
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> '/home/dominik/.mplayer/fonts'
Using nanosleep() timing
get_path('input.conf') -> '/home/dominik/.mplayer/input.conf'
Parsing input config file /home/dominik/.mplayer/input.conf
Input config file /home/dominik/.mplayer/input.conf parsed: 62 binds
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
get_path('.conf') -> '/home/dominik/.mplayer/.conf'

Playing tv://.
get_path('sub/') -> '/home/dominik/.mplayer/sub/'
STREAM: [tv] tv://
STREAM: Description: TV Input
STREAM: Author: Benjamin Zores, Albeu
STREAM: Comment: 
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
v4l2: unable to open '/dev/video1': No such file or directory
v4l2: ioctl set mute failed: Bad file descriptor
v4l2: 0 frames successfully processed, 0 frames dropped.
v4l2: up to 0 video frames buffered.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912496243952 (LWP 16457)]
demux_close_tv (demuxer=0xee9280) at tv.c:628
628         tvh->functions->uninit(tvh->priv);
(gdb) bt full
#0  demux_close_tv (demuxer=0xee9280) at tv.c:628
        tvh = (tvi_handle_t *) 0x0
#1  0x00000000004e99d2 in free_demuxer (demuxer=0xee9280) at demuxer.c:266
        i = <value optimized out>
#2  0x00000000004ea007 in demux_open_stream (stream=0xee88c0, file_format=9, force=0, audio_id=-1, video_id=-1, 
    dvdsub_id=-2, filename=0xed23a0 "tv://") at demuxer.c:688
        demuxer = (demuxer_t *) 0x0
        demuxer_desc = <value optimized out>
        fformat = 9
#3  0x00000000004ea216 in demux_open (vs=0xee88c0, file_format=7, audio_id=4301136, video_id=-1, dvdsub_id=-2, 
    filename=0xed23a0 "tv://") at demuxer.c:842
        as = (stream_t *) 0x0
        ss = (stream_t *) 0x0
        vd = <value optimized out>
        ad = <value optimized out>
        sd = <value optimized out>
        afmt = 0
        sfmt = 0
        audio_demuxer_type = 0
        sub_demuxer_type = 0
        demuxer_force = 0
        audio_demuxer_force = 0
        sub_demuxer_force = 0
#4  0x0000000000412c41 in main (argc=<value optimized out>, argv=<value optimized out>) at mplayer.c:3501
        entry = (play_tree_t *) 0x1b
        cmd = (mp_cmd_t *) 0xee5610
        mem_ptr = 0xee5610 ""
        file_format = 9
        rtc_fd = -1
        opt_exit = 27
        i = 27
        tmp = <value optimized out>
        vf_vo_data = {pts = 0, vo = 0x7fff6c6a0640}
        drop_message = 0

Trivial patch attached.

Regards,
R.

-- 
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
	-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20771/stream/tv.c.segv	2006-08-29 23:19:55.000000000 +0200
+++ MPlayer-20771/stream/tv.c	2006-11-09 23:02:27.000000000 +0100
@@ -625,7 +625,7 @@
 static void demux_close_tv(demuxer_t *demuxer)
 {
     tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv);
-    tvh->functions->uninit(tvh->priv);
+    if (tvh) tvh->functions->uninit(tvh->priv);
 }
 
 /* ================== STREAM_TV ===================== */


More information about the MPlayer-dev-eng mailing list