[MPlayer-dev-eng] [PATCH] avoid null dereference crash when -edlout w/o vid

Robert Henney robh at rut.org
Wed May 3 02:59:20 CEST 2006


it's seems unfortunate that the EDL Mark command cannot be used on audio
only material (it could be utilizied as a low-tech way to generate
timings to a wav file for subtitling purposes, for instance), but it's
more unfortunate I suppose that a crash results if one attempts to use
it on material with no video stream.

the attached patch adds a sanity check that prevents the crash.

I didn't attempt to go further, but am hoping someone else might. :)
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.951
diff -u -r1.951 mplayer.c
--- mplayer.c	27 Apr 2006 22:13:59 -0000	1.951
+++ mplayer.c	3 May 2006 00:43:57 -0000
@@ -4198,7 +4198,7 @@
         free(tmp);
     } break;
     case MP_CMD_EDL_MARK:
-      if( edl_fd ) {
+      if( edl_fd && sh_video != NULL ) {
 	float v = sh_video->pts;
 	fprintf( edl_fd, "%f %f %d\n", v-2, v, 0 );
       }


More information about the MPlayer-dev-eng mailing list