# HG changeset patch # User reimar # Date 1262278004 0 # Node ID 31b7d4637b50f95e4339138eb9f2e1b72f91afd2 # Parent 8b7ff54da7502e79be19e741f59690559110db08 Fix crash if http reply contains neither "Accept-Ranges" nor "Server" fields. diff -r 8b7ff54da750 -r 31b7d4637b50 stream/http.c --- a/stream/http.c Thu Dec 31 11:29:21 2009 +0000 +++ b/stream/http.c Thu Dec 31 16:46:44 2009 +0000 @@ -768,9 +768,10 @@ // 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 }