mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-10 05:32:40 -05:00
Codecs: mp4: Improve support for long files, prevent endless loop
pretty unlikely but I think in a memory exaustion scenario you might roll the uint8 over to zero and crash Change-Id: If73dc64484f2d363446be068aa7bf8025407a2a7
This commit is contained in:
parent
b3abb27179
commit
6b0e3fe775
1 changed files with 2 additions and 2 deletions
|
|
@ -475,14 +475,14 @@ static bool read_chunk_stco(qtmovie_t *qtmovie, size_t chunk_len)
|
||||||
{
|
{
|
||||||
qtmovie->res->lookup_table = malloc(fit_numentries * sizeof(*qtmovie->res->lookup_table));
|
qtmovie->res->lookup_table = malloc(fit_numentries * sizeof(*qtmovie->res->lookup_table));
|
||||||
|
|
||||||
if (qtmovie->res->lookup_table)
|
if (qtmovie->res->lookup_table || (++accuracy_divider == 0))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// we failed to alloc memory for lookup table, so reduce seek accuracy and try again
|
// we failed to alloc memory for lookup table, so reduce seek accuracy and try again
|
||||||
fit_numentries = numentries / ++accuracy_divider;
|
fit_numentries = numentries / accuracy_divider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEBUGF("lookup_table numentries %d, fit_numentries %d\n", numentries, fit_numentries);
|
DEBUGF("lookup_table numentries %d, fit_numentries %d\n", numentries, fit_numentries);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue