summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {