summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-31 16:46:44 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-12-31 16:46:44 +0000
commitb78313acd8890b2f2181efb92273ae80264a38c1 (patch)
tree0e5c1fd338cfa786aa40d62d00b26579acda61db /stream
parent54e6b786f41a9803f4c5c311ec7b310dad2acc16 (diff)
downloadmpv-b78313acd8890b2f2181efb92273ae80264a38c1.tar.bz2
mpv-b78313acd8890b2f2181efb92273ae80264a38c1.tar.xz
Fix crash if http reply contains neither "Accept-Ranges" nor "Server" fields.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30147 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream/http.c b/stream/http.c
index d806632117..d81491c6b9 100644
--- a/stream/http.c
+++ b/stream/http.c
@@ -768,9 +768,10 @@ static int http_streaming_start(stream_t *stream, int* file_format) {
// 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
}