[MEncoder-users] [PATCH] Segfault when encoding from mkv file
Dominique Dumont
domi.dumont at free.fr
Thu Jun 7 21:16:45 CEST 2007
Hello
Mencoder seg faults when encoding from a mkv file (without embedded
subtitles):
Core was generated by `./mencoder Test.mkv -oac copy -vf scale=1280:534,crop=128 0:528:0:3 -ovc x264 -x'.
Program terminated with signal 11, Segmentation fault.
#0 ass_add_font (priv=0x0, name=0xf744e0 "TCCEB.TTF", data=0xf74530 "",
size=74708) at ass_library.c:87
87 grow_array((void**)&priv->fontdata, priv->num_fontdata, sizeof(* priv->fontdata));
(gdb) bt
#0 ass_add_font (priv=0x0, name=0xf744e0 "TCCEB.TTF", data=0xf74530 "",
size=74708) at ass_library.c:87
#1 0x00000000004d8bee in demux_mkv_open (demuxer=0xf6b190) at demux_mkv.c:1539
#2 0x00000000004c27d6 in demux_open_stream (stream=0xf6a7d0, file_format=0,
force=0, audio_id=-1, video_id=-1, dvdsub_id=-2,
filename=0xf487b0 "Test.mkv") at demuxer.c:722
#3 0x00000000004c2cf5 in demux_open (vs=0xf6a7d0, file_format=16205024,
audio_id=74708, video_id=-1, dvdsub_id=1, filename=0xf487b0 "Test.mkv")
at demuxer.c:867
#4 0x0000000000437dfa in main (argc=<value optimized out>,
argv=<value optimized out>) at mencoder.c:590
(gdb)
>From why I've understood, the global ass_library (priv in add_ass_font)
is null.
It's probably normal not to care about ass subtitles (or any
subtitles) while encoding, but demux_mkv_open should check ass_library
before calling ass_add_font.
Here's a small patch for this.
Encoding starts normally with this patch.
HTH
Index: libmpdemux/demux_mkv.c
===================================================================
--- libmpdemux/demux_mkv.c (revision 23496)
+++ libmpdemux/demux_mkv.c (working copy)
@@ -1534,6 +1534,7 @@
name, mime, data_size);
#ifdef USE_ASS
if (extract_embedded_fonts && name && data && data_size &&
+ ass_library &&
mime && (strcmp(mime, "application/x-truetype-font") == 0 ||
strcmp(mime, "application/x-font") == 0))
ass_add_font(ass_library, name, data, data_size);
More information about the MEncoder-users
mailing list