[MPlayer-dev-eng] Segmentation fault when calling xvid encoding filter, patch included
Werner Kehlenbach
w.kehlenbach at web.de
Sat Jun 11 16:53:34 CEST 2005
Hello bughunters,
I recently installed the XviD video coder (V 1.1.0beta2) and wanted to code a
DVD to XviD. mplayer crashed at loadiing of the filter. A trace with gdb is
included below.
I traced the problem to mplayers (MPlayer-1.0pre7) code line 458 if(args
&& strcmp(args[0],"_oldargs_")) {
in vf.c
The reason is that *args=0 (see mem dump below) and the strcmp can not handle
this and crashes. I also attach the modified function avoiding this as a
patch. I successfully thereafter generated a XviD file from DVD.
Please answer me if anybody thinks this or a similar code change is done in
the mplayer code and maybe I also get a mention in the Changelog file, lets
see.
See also: http://lists.debian.org/debian-user/2005/03/msg00090.html
- Werner
----------------------------------------------------------------------
chief at fuchs:~/dump$ gdb mencoder
GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db
library "/lib/libthread_db.so.1".
(gdb) set args dvd://2 -chapter 1-1 -dvd-device '/dev/dvd' -alang un -oac
mp3lame -lameopts abr:br=128:aq=0 -nocache -noaspect -noautoexpand -noskip
-vf-add softskip,crop=720:576,pp=hb/vb/dr,scale=: -o /dev/null -ovc xvid
-xvidencopts bitrate=1230:vhq=2:pass=1
(gdb) run
Starting program: /usr/bin/mencoder dvd://2 -chapter 1-1 -dvd-device
'/dev/dvd' -alang un -oac mp3lame -lameopts abr:br=128:aq=0 -nocache
-noaspect -noautoexpand -noskip -vf-add
softskip,crop=720:576,pp=hb/vb/dr,scale=: -o /dev/null -ovc xvid
-xvidencopts bitrate=1230:vhq=2:pass=1
[Thread debugging using libthread_db enabled]
[New Thread -1217362256 (LWP 7543)]
Using GNU internationalization
Original domain: messages
Original dirname: /usr/share/locale
Current domain: mplayer
Current dirname: /usr/share/locale
MEncoder 1.0pre7-3.4.3 (C) 2000-2005 MPlayer Team
CPU: Advanced Micro Devices Athlon MP/XP Thoroughbred (Family: 6, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
File not found: 'frameno.avi'
Failed to open frameno.avi
Reading disc structure, please wait...
There are 12 titles on this DVD.
There are 1 chapters in this DVD title.
There are 1 angles in this DVD title.
DVD successfully opened.
success: format: 0 data: 0x930800 - 0x2d72800
No matching DVD audio language found!
MPEG-PS file format detected.
VIDEO: MPEG2 720x576 (aspect 2) 25.000 fps 6000.0 kbps (750.0 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.00 ftime:=0.0400
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->192000)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
xvid: using library version 1.1.-125 (build xvid-1.1.0-beta2)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1217362256 (LWP 7543)]
0x080b25a8 in vf_open_filter (next=0xa, name=0x8690068 "scale",
args=0x8690078)
at vf.c:458
458 if(args && strcmp(args[0],"_oldargs_")) {
(gdb) back
#0 0x080b25a8 in vf_open_filter (next=0xa, name=0x8690068 "scale",
args=0x8690078) at vf.c:458
#1 0x080b2f0f in append_filters (last=0x86e7240) at vf.c:657
#2 0x080726a8 in main (argc=10, argv=0xa) at mencoder.c:818
(gdb) x/16 0x8690078
0x8690078: 0x00000000 0x00000000 0x00000000 0x00000011
0x8690088: 0x08690098 0x00000000 0x00000000 0x00001059
0x8690098: 0x0868fed0 0x00000007 0x00000007 0x00001732
0x86900a8: 0x081a2300 0x081a2380 0x081a2460 0x00000000
(gdb)
----------------------------------------------------------------------
vf_instance_t* vf_open_filter(vf_instance_t* next, char *name, char **args){
int resultat=0;
if (args &&(*args)) { resultat=strcmp(args[0],"_oldargs_"); }
if(args && resultat) {
int i,l = 0;
for(i = 0 ; args && args[2*i] ; i++)
l += 1 + strlen(args[2*i]) + 1 + strlen(args[2*i+1]);
l += strlen(name);
{
char str[l+1];
char* p = str;
p += sprintf(str,"%s",name);
for(i = 0 ; args && args[2*i] ; i++)
p += sprintf(p," %s=%s",args[2*i],args[2*i+1]);
mp_msg(MSGT_VFILTER,MSGL_INFO,MSGTR_OpeningVideoFilter "[%s]\n",str);
}
} else if(strcmp(name,"vo")) {
if(args && resultat == 0)
mp_msg(MSGT_VFILTER,MSGL_INFO,MSGTR_OpeningVideoFilter
"[%s=%s]\n", name,args[1]);
else
mp_msg(MSGT_VFILTER,MSGL_INFO,MSGTR_OpeningVideoFilter
"[%s]\n", name);
}
return vf_open_plugin(filter_list,next,name,args);
}
--
--------------------------------------------------------------------
Jeder kann unverschlüsselte Emails lesen, deshalb verwenden
Sie bitte nach Möglichkeit PGP zur Signierung und/oder
Verschlüsselung von Emails an mich. Vielen Dank!
Mein Schlüssel kann unter folgender Adresse geladen werden:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xB3268290
Mein elektronischer Fingerabdruck:
9BC2 6A7B D834 6CC3 8EC7 92D0 90C5 AC90 B326 8290
Mehr Informationen zu PGP unter:
http://www.helmbold.de/pgp/
Download unter:
http://www.pgpi.org/products/pgp/versions/freeware/
--------------------------------------------------------------------
More information about the MPlayer-dev-eng
mailing list