Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

metadata: opus, vorbis, speex: Fix 0 is supplied as base64 char when parsing album art metadata

For some reason it caused a crash on asan enabled simulator builds but worked fine otherwise.

Fixup for 0847bcc1 and ac8714dd

Change-Id: Iff1c2779d5fa6889c743cdccd8e1feaf55684394

authored by

Roman Artiukhin and committed by
Solomon Peachy
849e8abe b6f8f31b

+5 -5
+5 -5
lib/rbcodec/metadata/vorbis.c
··· 326 326 } 327 327 break; 328 328 } 329 - 330 329 int index = in[i] - B64_START_CHAR; 331 - if (index < 0 || index >= (int)ARRAYLEN(b64_codes)) 330 + #ifdef SIMULATOR 331 + if (index < 0 || index >= (int)ARRAYLEN(b64_codes) || b64_codes[index] < 0) 332 332 { 333 - out[len] = '\0'; 333 + DEBUGF("Invalid base64 char: '%c', char code: %i.\n", in[i], in[i]); 334 334 break; 335 335 } 336 - 336 + #endif 337 337 val = (val << 6) | b64_codes[index]; 338 338 339 339 if ((++i & 3) == 0) ··· 429 429 int after_block_pos = lseek(fd, 0, SEEK_CUR); 430 430 431 431 char* buf = id3->path; 432 - size_t outlen = base64_decode(buf, MIN(read_len, (int32_t) sizeof(id3->path)), buf); 432 + size_t outlen = base64_decode(buf, MIN(read_len, (int32_t) sizeof(id3->path) - 1), buf); 433 433 434 434 int picframe_pos; 435 435 parse_flac_album_art(buf, outlen, &id3->albumart.type, &picframe_pos);