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.

[Bugfix] metadata.c copy_mp3entry() dest and orig may overlap

I meant to add this with the last patch b07d7d6
since it may supply UNBUFFERED_ID3 to the peek function
which uses UNBUFFERED_ID3 and will try to copy it back
wich is undefined behavior for memcpy

Change-Id: I91160570adac22134c84d3b37f8fcecb097d87d6

authored by

William Wilgus and committed by
William Wilgus
1643e0e2 b07d7d6a

+5 -2
+5 -2
lib/rbcodec/metadata/metadata.c
··· 522 522 523 523 void copy_mp3entry(struct mp3entry *dest, const struct mp3entry *orig) 524 524 { 525 - memcpy(dest, orig, sizeof(struct mp3entry)); 526 - adjust_mp3entry(dest, dest, orig); 525 + if (dest != orig) 526 + { 527 + memcpy(dest, orig, sizeof(struct mp3entry)); 528 + adjust_mp3entry(dest, dest, orig); 529 + } 527 530 } 528 531 529 532 /* A shortcut to simplify the common task of clearing the struct */