changeset 655:c9bd2357f2d4 libavutil

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".
author stefano
date Sun, 08 Feb 2009 21:00:39 +0000
parents b751ac480294
children eadb97de8dc0
files base64.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/base64.c	Fri Feb 06 23:29:25 2009 +0000
+++ b/base64.c	Sun Feb 08 21:00:39 2009 +0000
@@ -79,7 +79,7 @@
     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) {