Commit 0d20c3fd authored by Stefano Sabatini's avatar Stefano Sabatini

Make av_base64_encode() do not require the user to provide an

overallocated buffer where to put the encoded string.

See the thread:
"[PATCH] Improve documentation for libavutil/base64.h".

Originally committed as revision 17065 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent dd02ea11
...@@ -79,7 +79,7 @@ char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len) ...@@ -79,7 +79,7 @@ char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len)
int bytes_remaining = len; int bytes_remaining = len;
if (len >= UINT_MAX / 4 || if (len >= UINT_MAX / 4 ||
buf_len < len * 4 / 3 + 12) buf_len < (len+2) / 3 * 4 + 1)
return NULL; return NULL;
ret = dst = buf; ret = dst = buf;
while (bytes_remaining) { while (bytes_remaining) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment