forked from len0rd/rockbox
Prevent two division by zeros and one problem causing a crash in the
mp3 metadata parser. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9438 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ea6b4cbe4f
commit
93b6a1d12c
3 changed files with 19 additions and 2 deletions
|
|
@ -2359,8 +2359,11 @@ static void mp3_set_elapsed(struct mp3entry* id3)
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* constant bitrate, use exact calculation */
|
||||
id3->elapsed = id3->offset / (id3->bitrate / 8);
|
||||
if (id3->bitrate != 0)
|
||||
id3->elapsed = id3->offset / (id3->bitrate / 8);
|
||||
}
|
||||
}
|
||||
|
||||
/* Copied from mpeg.c. Should be moved somewhere else. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue