FS13713: Fix null ponter deref with mp4 files with a tracknum of 0

mp4 metadata doesn't use strtol, so needs to handle things differently.

Change-Id: Idb54fae845b08222ea6b79870f6b99390af9c684
This commit is contained in:
Solomon Peachy 2025-12-13 17:50:31 -05:00
parent 75df18f2c1
commit bc627659ec

View file

@ -482,10 +482,9 @@ static bool read_mp4_tags(int fd, struct mp3entry* id3,
break;
case MP4_trkn: {
char *p = NULL;
int tracknum = 0;
read_mp4_tag_i_from_n(fd, &tracknum, &id3->track_string, size, &buffer_left, &buffer);
if (!(tracknum == 0 && (errno || *p)))
if (!(tracknum == 0 && (id3->track_string && *id3->track_string)))
id3->tracknum = tracknum;
break;
}