avformat/utils: Change compute_chapters_end() from O(n²) to O(n log n)
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 21 Nov 2020 13:51:25 +0000 (14:51 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 8 Jan 2021 17:02:55 +0000 (18:02 +0100)
commitac5a568e6dff8162a2e982f3571b925f1b207e2c
tree77b045bb110a53d71f5d94b59f3e91a988556597
parenta454a0c14fa2c2bf712f282a7fcc574bdc90a327
avformat/utils: Change compute_chapters_end() from O(n²) to O(n log n)

Fixes: Timeout (49sec -> 9sec)
Fixes: 27427/clusterfuzz-testcase-minimized-ffmpeg_dem_FFMETADATA_fuzzer-5140589838073856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/utils.c