1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avformat/mov: don't set stsc_count for item streams before the array is allocated

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2025-08-01 19:13:15 -03:00
parent 89187a84d3
commit 999e3e9bf8

View File

@ -5427,10 +5427,10 @@ static int heif_add_stream(MOVContext *c, HEIFItem *item)
av_dict_set(&st->metadata, "title", item->name, 0);
// Populate the necessary fields used by mov_build_index.
sc->stsc_count = 1;
sc->stsc_data = av_malloc_array(1, sizeof(*sc->stsc_data));
if (!sc->stsc_data)
goto fail;
sc->stsc_count = 1;
sc->stsc_data[0].first = 1;
sc->stsc_data[0].count = 1;
sc->stsc_data[0].id = 1;