From 8e2a58f85f68077944bb5739f2327353a502ed70 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Thu, 19 Aug 2021 16:08:46 +0200 Subject: [PATCH] mp4: Remove two unused arrays from struct mp4_track. These arrays are allocated and initialized but their values are never read. --- mp4.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/mp4.c b/mp4.c index 09a3c743..c77cedd2 100644 --- a/mp4.c +++ b/mp4.c @@ -25,13 +25,11 @@ struct mp4_track { /* stts */ uint32_t stts_entry_count; uint32_t *stts_sample_count; - uint32_t *stts_sample_delta; /* stsc */ uint32_t stsc_entry_count; uint32_t *stsc_first_chunk; uint32_t *stsc_samples_per_chunk; - uint32_t *stsc_sample_desc_index; /* stsc */ uint32_t stco_entry_count; @@ -493,13 +491,11 @@ static int read_stts(struct mp4 *f) return ret; t->stts_sample_count = para_malloc(t->stts_entry_count * sizeof(int32_t)); - t->stts_sample_delta = para_malloc(t->stts_entry_count - * sizeof (int32_t)); for (i = 0; i < t->stts_entry_count; i++) { ret = read_int32(f, &t->stts_sample_count[i]); if (ret <= 0) return ret; - ret = read_int32(f, &t->stts_sample_delta[i]); + ret = read_int32(f, NULL); /* sample delta */ if (ret <= 0) return ret; } @@ -528,9 +524,6 @@ static int read_stsc(struct mp4 *f) t->stsc_first_chunk = para_malloc(t->stsc_entry_count * sizeof(int32_t)); t->stsc_samples_per_chunk = para_malloc(t->stsc_entry_count * sizeof (int32_t)); - t->stsc_sample_desc_index = para_malloc(t->stsc_entry_count * - sizeof (int32_t)); - for (i = 0; i < t->stsc_entry_count; i++) { ret = read_int32(f, &t->stsc_first_chunk[i]); if (ret <= 0) @@ -538,7 +531,7 @@ static int read_stsc(struct mp4 *f) ret = read_int32(f, &t->stsc_samples_per_chunk[i]); if (ret <= 0) return ret; - ret = read_int32(f, &t->stsc_sample_desc_index[i]); + ret = read_int32(f, NULL); /* sample desc index */ if (ret <= 0) return ret; } @@ -970,10 +963,8 @@ void mp4_close(struct mp4 *f) if (f->track[i]) { free(f->track[i]->stsz_table); free(f->track[i]->stts_sample_count); - free(f->track[i]->stts_sample_delta); free(f->track[i]->stsc_first_chunk); free(f->track[i]->stsc_samples_per_chunk); - free(f->track[i]->stsc_sample_desc_index); free(f->track[i]->stco_chunk_offset); free(f->track[i]); } -- 2.39.2