From 999e3e9bf80a8595f5ff65019001b3a3c0628c79 Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 1 Aug 2025 19:13:15 -0300 Subject: [PATCH] avformat/mov: don't set stsc_count for item streams before the array is allocated Signed-off-by: James Almer --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 92d6e2a2f5..37f24a6beb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -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;