aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2009-02-08 21:00:39 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2009-02-08 21:00:39 +0000
commit0d20c3fdad10324b262eda3a22bc9947d1d5911b (patch)
tree054cc946d73f32e935a042b3a11c4055479b3145
parentdd02ea118bf89f94090902e3ef2287abdaf3e3b1 (diff)
downloadffmpeg-0d20c3fdad10324b262eda3a22bc9947d1d5911b.tar.gz
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
-rw-r--r--libavutil/base64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/base64.c b/libavutil/base64.c
index 2c980cfefd..8497a67796 100644
--- a/libavutil/base64.c
+++ b/libavutil/base64.c
@@ -79,7 +79,7 @@ char *av_base64_encode(char * buf, int buf_len, const uint8_t * src, int len)
int bytes_remaining = len;
if (len >= UINT_MAX / 4 ||
- buf_len < len * 4 / 3 + 12)
+ buf_len < (len+2) / 3 * 4 + 1)
return NULL;
ret = dst = buf;
while (bytes_remaining) {