diff options
author | Martin Storsjö <martin@martin.st> | 2023-03-21 13:29:44 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2023-04-02 00:34:53 +0300 |
commit | c221036502751d7a6e1403a9868c60f1ff357963 (patch) | |
tree | d13ba7e3a4e1c765e86c58df17322e69c06e968f /libavcodec/riscv/alacdsp_init.c | |
parent | 33d06de6381aeaf0e6281f8ba0a39ed3bfda19fa (diff) | |
download | ffmpeg-c221036502751d7a6e1403a9868c60f1ff357963.tar.gz |
libavformat: Improve ff_configure_buffers_for_index for excessive deltas
Previously, the ff_configure_buffers_for_index function had
upper sanity limits of 16 MB (1<<24) for buffer_size and
8 MB (1<<23) for short_seek_threshold.
However, if the index contained entries with a much larger
delta, setting pos_delta to a value larger than the sanity
limit, we would end up not increasing the buffer size at all.
Instead, ignore the individual deltas that are excessive, but
increase the buffer size based on the deltas that are below the
sanity limit.
Only count deltas that are below 1<<23, 8 MB; pos_delta gets doubled
before setting the buffer size - this matches the previous maximum
buffer size of 1<<24, 16 MB.
This can happen e.g. with a mov file with some tracks containing
some samples that belong in the start of the file, at the end of
the mdat, while the rest of the file is mostly reasonably interleaved;
previously those samples caused the maximum pos_delta to skyrocket,
skipping any buffer size enlargement.
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavcodec/riscv/alacdsp_init.c')
0 files changed, 0 insertions, 0 deletions