Browse Source

Reduce allocated length of the HTTP authentication request field buffer, as

noticed by Stefano and Luca in the "[PATCH]RTSP Basic Authentication"
mailinglist thread.

av_base64_encode() was recently changed. The previous implementation required
12 extra bytes (ceil(len(src)/3.)*4+12), whereas the new one is guaranteed to
fit in an exact buffer (ceil(len(src)/3.)*4), plus one extra byte for the
trailing zero. This change fixes no bug, it just slightly decreases the
amount of allocated memory.

Originally committed as revision 17761 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.6
Ronald S. Bultje 16 years ago
parent
commit
d176f90387
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/http.c

+ 1
- 1
libavformat/http.c View File

@@ -212,7 +212,7 @@ 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;
int auth_b64_len = (strlen(auth) + 2) / 3 * 4 + 1;
int64_t off = s->off;




Loading…
Cancel
Save