[FFmpeg-cvslog] r17065 - trunk/libavutil/base64.c

stefano subversion
Sun Feb 8 22:00:40 CET 2009


Author: stefano
Date: Sun Feb  8 22:00:39 2009
New Revision: 17065

Log:
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".

Modified:
   trunk/libavutil/base64.c

Modified: trunk/libavutil/base64.c
==============================================================================
--- trunk/libavutil/base64.c	Sun Feb  8 21:28:12 2009	(r17064)
+++ trunk/libavutil/base64.c	Sun Feb  8 22:00:39 2009	(r17065)
@@ -79,7 +79,7 @@ char *av_base64_encode(char * buf, int b
     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) {




More information about the ffmpeg-cvslog mailing list