[MPlayer-dev-eng] Fix when seeking in mpegts using -demuxer lavf

Etienne Buira etienne.buira at free.fr
Thu Aug 4 21:36:16 CEST 2011


Hi all.

Ran into this when playing a mpegts file with -demuxer lavf, r33952 with
ffmpeg 1816addc.

A:47387.359 V:47387.615 A-V: -0.255 ct: -0.184   0/  0  6%  0%  0.5% 1 0 
Program received signal SIGSEGV, Segmentation fault.
mp_msp_av_log_callback (ptr=0x16b8ab0, level=24, fmt=0xca1d29 "Continuity Check Failed\n", vl=0x7fffffffb590) at libmpcodecs/vd_ffmpeg.c:201
201             if(!strcmp(avc->class_name, "AVCodecContext")){
(gdb) p avc
$1 = (AVClass *) 0x0
(gdb) list
196         case AV_LOG_ERROR:  mp_level= MSGL_ERR ; break;
197         default          :  mp_level= level > AV_LOG_DEBUG ? MSGL_DBG2 : MSGL_ERR; break;
198         }
199
200         if(ptr){
201             if(!strcmp(avc->class_name, "AVCodecContext")){
202                 AVCodecContext *s= ptr;
203                 if(s->codec){
204                     if(s->codec->type == AVMEDIA_TYPE_AUDIO){
205                         if(s->codec->decode)
(gdb) p ptr
$2 = (void *) 0x16b8ab0
(gdb) p *(AVClass **)ptr
$3 = (AVClass *) 0x0

Attached patch fixes that.
-------------- next part --------------
Index: libmpcodecs/vd_ffmpeg.c
===================================================================
--- libmpcodecs/vd_ffmpeg.c	(revision 33952)
+++ libmpcodecs/vd_ffmpeg.c	(working copy)
@@ -197,7 +197,7 @@
     default          :  mp_level= level > AV_LOG_DEBUG ? MSGL_DBG2 : MSGL_ERR; break;
     }
 
-    if(ptr){
+    if(ptr && avc){
         if(!strcmp(avc->class_name, "AVCodecContext")){
             AVCodecContext *s= ptr;
             if(s->codec){


More information about the MPlayer-dev-eng mailing list