From 114881cd1c088860693df41d82308f329d4f8148 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Wed, 25 Mar 2020 16:13:55 +0100 Subject: [PATCH] [misc] Add comment for commit 27138ed --- src/misc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc.c b/src/misc.c index 2c4a9348..737cda81 100644 --- a/src/misc.c +++ b/src/misc.c @@ -823,7 +823,9 @@ b64_decode(int *dstlen, const char *src) len = AV_BASE64_DECODE_SIZE(strlen(src)); - CHECK_NULL(L_MISC, out = calloc(1, len+1)); + // Add a extra zero byte just in case we are decoding a string without null + // termination + CHECK_NULL(L_MISC, out = calloc(1, len + 1)); ret = av_base64_decode(out, src, len); if (ret < 0)