# HG changeset patch # User mstorsjo # Date 1275995196 0 # Node ID 44ee60d0c688d0a8122d2013990b337e673a25f1 # Parent c0336d3528e9617c810792cc32d2c3b87cf596b8 Fix bugs in the http custom header handling Initialize the buffer av_strlcatf writes into. Add the dash at the end of the Range header. 10l to me for not spotting it earlier diff -r c0336d3528e9 -r 44ee60d0c688 http.c --- a/http.c Tue Jun 08 10:44:27 2010 +0000 +++ b/http.c Tue Jun 08 11:06:36 2010 +0000 @@ -270,7 +270,7 @@ HTTPContext *s = h->priv_data; int post, err; char line[1024]; - char headers[1024]; + char headers[1024] = ""; char *authstr = NULL; int64_t off = s->off; int len = 0; @@ -290,7 +290,7 @@ sizeof(headers) - len); if (!has_header(s->headers, "\r\nRange: ")) len += av_strlcatf(headers + len, sizeof(headers) - len, - "Range: bytes=%"PRId64"\r\n", s->off); + "Range: bytes=%"PRId64"-\r\n", s->off); if (!has_header(s->headers, "\r\nConnection: ")) len += av_strlcpy(headers + len, "Connection: close\r\n", sizeof(headers)-len);