[MPlayer-dev-eng] [PATCH] Segfault in network.c:757

Daniel Serpell daniel at atmlab.utfsm.cl
Thu Feb 26 15:42:53 CET 2004


Hi!

Trying:
  mplayer http://171.64.115.101/courses/ee380/040107-ee380-100.wmv

Mplayer crashes with a segfault. Problem is in network.c, line 757
(current CVS).

Attached is my proposed patch.

Thanks,

    Daniel.

-------------- next part --------------
Index: libmpdemux/network.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/network.c,v
retrieving revision 1.90
diff -u -r1.90 network.c
--- libmpdemux/network.c	17 Feb 2004 12:30:44 -0000	1.90
+++ libmpdemux/network.c	26 Feb 2004 14:41:56 -0000
@@ -754,7 +754,14 @@
 			streaming_ctrl->data = (void*)http_hdr;
 
 			// Check if we can make partial content requests and thus seek in http-streams
-		        seekable=(http_hdr!=NULL && http_hdr->status_code==200 && strncmp(http_get_field(http_hdr,"Accept-Ranges"),"bytes",5)==0);
+			seekable = 0;
+			if( http_hdr!=NULL && http_hdr->status_code==200 )
+			{
+				char *field;
+				field = http_get_field(http_hdr,"Accept-Ranges");
+				if( field )
+				    seekable = strncmp(field,"bytes",5)==0;
+			}
 
 			// Check if the response is an ICY status_code reason_phrase
 			if( !strcasecmp(http_hdr->protocol, "ICY") ) {


More information about the MPlayer-dev-eng mailing list