[MPlayer-cvslog] r30147 - trunk/stream/http.c

reimar subversion at mplayerhq.hu
Thu Dec 31 17:46:44 CET 2009


Author: reimar
Date: Thu Dec 31 17:46:44 2009
New Revision: 30147

Log:
Fix crash if http reply contains neither "Accept-Ranges" nor "Server" fields.

Modified:
   trunk/stream/http.c

Modified: trunk/stream/http.c
==============================================================================
--- trunk/stream/http.c	Thu Dec 31 12:29:21 2009	(r30146)
+++ trunk/stream/http.c	Thu Dec 31 17:46:44 2009	(r30147)
@@ -768,9 +768,10 @@ static int http_streaming_start(stream_t
 		// Check if we can make partial content requests and thus seek in http-streams
 		if( http_hdr!=NULL && http_hdr->status_code==200 ) {
 		    char *accept_ranges;
+		    const char *server = http_get_field(http_hdr, "Server");
 		    if( (accept_ranges = http_get_field(http_hdr,"Accept-Ranges")) != NULL )
 			seekable = strncmp(accept_ranges,"bytes",5)==0;
-		    else if (strcmp(http_get_field(http_hdr, "Server"), "gvs 1.0") == 0)
+		    else if (server && strcmp(server, "gvs 1.0") == 0)
 			seekable = 1; // HACK for youtube incorrectly claiming not to support seeking
 		}
 


More information about the MPlayer-cvslog mailing list