aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2007-03-19 00:48:47 +0000
committerLuca Barbato <lu_zero@gentoo.org>2007-03-19 00:48:47 +0000
commitbd03c380ce67cffaaf3c456407cc98e02917ebf7 (patch)
treebeccff1ab797befddbd59f9e744d57d847a443e1 /libavformat/http.c
parent559fd1e79524ca47efde195e28feb4499dd48761 (diff)
downloadffmpeg-bd03c380ce67cffaaf3c456407cc98e02917ebf7.tar.gz
expose av_base64_decode and av_base64_encode
Originally committed as revision 8448 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 9e8fce59ab..e057d6efe9 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -210,13 +210,14 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr,
int post, err, ch;
char line[1024], *q;
char *auth_b64;
+ int auth_b64_len = strlen(auth)* 4 / 3 + 12;
offset_t off = s->off;
/* send http header */
post = h->flags & URL_WRONLY;
-
- auth_b64 = av_base64_encode((uint8_t *)auth, strlen(auth));
+ auth_b64 = av_malloc(auth_b64_len);
+ av_base64_encode(auth_b64, auth_b64_len, (uint8_t *)auth, strlen(auth));
snprintf(s->buffer, sizeof(s->buffer),
"%s %s HTTP/1.1\r\n"
"User-Agent: %s\r\n"