[MPlayer-cvslog] r33954 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Tue Aug 9 19:20:45 CEST 2011


Author: reimar
Date: Tue Aug  9 19:20:44 2011
New Revision: 33954

Log:
Avoid crash and instead print a warning if the av_log callback
context has a broken (NULL) class.

Based on patch by Etienne Buira [etienne buira free fr]

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Thu Aug  4 21:30:26 2011	(r33953)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Tue Aug  9 19:20:44 2011	(r33954)
@@ -197,7 +197,9 @@ static void mp_msp_av_log_callback(void 
     default          :  mp_level= level > AV_LOG_DEBUG ? MSGL_DBG2 : MSGL_ERR; break;
     }
 
-    if(ptr){
+    if (ptr && !avc)
+        mp_msg(MSGT_DECVIDEO, MSGL_ERR, "libav* called av_log with context containing a broken AVClass!\n");
+    if (avc) {
         if(!strcmp(avc->class_name, "AVCodecContext")){
             AVCodecContext *s= ptr;
             if(s->codec){


More information about the MPlayer-cvslog mailing list