diff options
Diffstat (limited to 'src/xine-engine/configfile.c')
-rw-r--r-- | src/xine-engine/configfile.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 37a4e38ad..a41abf193 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -33,7 +33,7 @@ #include <unistd.h> #include <xine/configfile.h> #include "bswap.h" -#include "base64.h" +#include <libavutil/base64.h> #define LOG_MODULE "configfile" #define LOG_VERBOSE @@ -1342,7 +1342,12 @@ static char* config_get_serialized_entry (config_values_t *this, const char *key } /* and now the output encoding */ - output = _x_base64_encode (buffer, total_len, &output_len); + /* We're going to encode total_len bytes in base64 + * libavutil's base64 encoding functions want the size to + * be at least len * 4 / 3 + 12, so let's use that! + */ + output = malloc(total_len * 4 / 3 + 12); + av_base64_encode(output, total_len * 4 / 3 + 12, buffer, total_len); free(buffer); } @@ -1410,11 +1415,13 @@ static char* config_register_serialized_entry (config_values_t *this, const char int bytes; int pos; void *output = NULL; - unsigned long output_len; + size_t output_len; int value_count = 0; int i; - output = _x_base64_decode (value, strlen(value), &output_len); + output_len = strlen(value) * 3 / 4 + 1; + output = malloc(output_len); + av_base64_decode(output, value, output_len); pos = 0; pos += bytes = get_int(output, output_len, pos, &type); |