From a9f2c3892fd346c8cfeec1d43dde4c2d58c8328f Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 8 Feb 2009 21:00:39 +0000 Subject: [PATCH] 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". git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17065 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- libavutil/base64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/base64.c b/libavutil/base64.c index 2c980cfef..8497a6779 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) { -- 2.39.2