1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-08-18 18:32:30 +02:00

Fix for ImageDecoder.cpp

This commit is contained in:
Norbert Walter
2026-03-04 18:37:44 +00:00
parent c5533ab0ef
commit a17db389fb
3 changed files with 25 additions and 6 deletions
+12 -3
View File
@@ -2,13 +2,22 @@
#include <mbedtls/base64.h>
// Decoder for Base64 content
bool ImageDecoder::decodeBase64(const String& base64, uint8_t* outBuffer, size_t outSize, size_t& decodedSize) {
bool ImageDecoder::decodeBase64(const char* base64, size_t base64Len, uint8_t* outBuffer, size_t outSize, size_t& decodedSize) {
if (base64 == nullptr) {
decodedSize = 0;
return false;
}
int ret = mbedtls_base64_decode(
outBuffer,
outSize,
&decodedSize,
(const unsigned char*)base64.c_str(),
base64.length()
(const unsigned char*)base64,
base64Len
);
return (ret == 0);
}
// Decoder for Base64 content
bool ImageDecoder::decodeBase64(const String& base64, uint8_t* outBuffer, size_t outSize, size_t& decodedSize) {
return decodeBase64(base64.c_str(), base64.length(), outBuffer, outSize, decodedSize);
}