From f4caa66a4b18720c5bcfbb1dea113a63c2132dc4 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 15 Apr 2015 17:58:40 +0200 Subject: [PATCH] Don't call findBase64CharIndex on invalid chars --- source/utils/CarlaBase64Utils.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/utils/CarlaBase64Utils.hpp b/source/utils/CarlaBase64Utils.hpp index d1d64ce29..56ced8b24 100644 --- a/source/utils/CarlaBase64Utils.hpp +++ b/source/utils/CarlaBase64Utils.hpp @@ -101,12 +101,12 @@ std::vector carla_getChunkFromBase64String(const char* const base64stri if (i != 0) { + for (j=0; j(charArray4[j])); + for (j=i; j<4; ++j) charArray4[j] = 0; - for (j=0; j<4; ++j) - charArray4[j] = CarlaBase64Helpers::findBase64CharIndex(static_cast(charArray4[j])); - charArray3[0] = (charArray4[0] << 2) + ((charArray4[1] & 0x30) >> 4); charArray3[1] = ((charArray4[1] & 0xf) << 4) + ((charArray4[2] & 0x3c) >> 2); charArray3[2] = ((charArray4[2] & 0x3) << 6) + charArray4[3];