mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
warble: zero the mp3entry before reading metadata
print_mp3entry() dereferences mb_track_id, but get_metadata() does not set every field of the uninitialized stack struct. For FLAC files this left garbage in the pointer and warble segfaulted in strlen about a third of the time, before decoding started. Clear the struct first. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
e9a6b58870
commit
8f38274e90
1 changed files with 3 additions and 0 deletions
|
|
@ -839,6 +839,9 @@ static void decode_file(const char *input_fn)
|
|||
|
||||
/* Set up ci */
|
||||
struct mp3entry id3;
|
||||
/* get_metadata() doesn't set every field; don't leave stack garbage in the
|
||||
pointers that print_mp3entry() dereferences */
|
||||
memset(&id3, 0, sizeof(id3));
|
||||
if (!get_metadata(&id3, input_fd, input_fn)) {
|
||||
fprintf(stderr, "error: metadata parsing failed\n");
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue