From 27138edd55325a25ed287f34b974d942c0c1c471 Mon Sep 17 00:00:00 2001 From: uvjustin <46082645+uvjustin@users.noreply.github.com> Date: Wed, 25 Mar 2020 14:57:23 +0800 Subject: [PATCH] Update misc.c Allocate extra byte for null termination of string --- src/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc.c b/src/misc.c index 3a91b44e..2c4a9348 100644 --- a/src/misc.c +++ b/src/misc.c @@ -823,7 +823,7 @@ b64_decode(int *dstlen, const char *src) len = AV_BASE64_DECODE_SIZE(strlen(src)); - CHECK_NULL(L_MISC, out = calloc(1, len)); + CHECK_NULL(L_MISC, out = calloc(1, len+1)); ret = av_base64_decode(out, src, len); if (ret < 0)