Revert "avformat/mov: zero initialize the index ranges buffer"

This reverts commit eee3b7e2fb.
It has been made in an attempt to fix UBSan test failures with
GCC 13 (see e.g. [1]), but it did not help at all. So revert it,
but use av_malloc_array() instead of going back to av_malloc().

[1]: https://fate.ffmpeg.org/report.cgi?slot=x86_64-archlinux-gcc-ubsan&time=20240226182430

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-02-26 22:58:58 +01:00
parent a6aa043baa
commit 9d7d03ea45

View File

@ -4031,7 +4031,8 @@ static void mov_fix_index(MOVContext *mov, AVStream *st)
}
// allocate the index ranges array
msc->index_ranges = av_calloc((msc->elst_count + 1), sizeof(msc->index_ranges[0]));
msc->index_ranges = av_malloc_array(msc->elst_count + 1,
sizeof(msc->index_ranges[0]));
if (!msc->index_ranges) {
av_log(mov->fc, AV_LOG_ERROR, "Cannot allocate index ranges buffer\n");
return;