forked from len0rd/rockbox
Commit both patches in FS#10833 - Protect against division by zero in AAC (mp4) codec by Juliusz Chroboczek. Adds some return value checking so that faad errors don't crash rockbox when decoding broken or unsupported files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23983 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
69a5ff7f8a
commit
d6ae8edc13
3 changed files with 8 additions and 6 deletions
|
@ -194,7 +194,8 @@ unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample)
|
|||
prev_chunk_samples = demux_res->sample_to_chunk[i].num_samples;
|
||||
}
|
||||
|
||||
if (sample >= demux_res->sample_to_chunk[0].num_samples)
|
||||
if (prev_chunk_samples > 0 &&
|
||||
sample >= demux_res->sample_to_chunk[0].num_samples)
|
||||
{
|
||||
chunk = prev_chunk + (sample - total_samples) / prev_chunk_samples;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue