History

avformat/mov: set array entry count after the array is allocated in heif_add_stream()

Ensures no bogus values being preserved after returning.

James Almer committed 1 year ago

Commit 64e6f5d1 parent 7039a371 file · +3 −3Browse files

Unified · Split

libavformat/mov.c+3−3
@@ -5430,18 +5430,18 @@ static int heif_add_stream(MOVContext *c, HEIFItem *item) · 5429 unmodified lines
54305430 sc->stsc_data[0].first = 1;
54315431 sc->stsc_data[0].count = 1;
54325432 sc->stsc_data[0].id = 1;
5433− sc->chunk_count = 1;
54345433 sc->chunk_offsets = av_malloc_array(1, sizeof(*sc->chunk_offsets));
54355434 if (!sc->chunk_offsets)
54365435 return AVERROR(ENOMEM);
5437− sc->sample_count = 1;
5436+ sc->chunk_count = 1;
54385437 sc->sample_sizes = av_malloc_array(1, sizeof(*sc->sample_sizes));
54395438 if (!sc->sample_sizes)
54405439 return AVERROR(ENOMEM);
5441− sc->stts_count = 1;
5440+ sc->sample_count = 1;
54425441 sc->stts_data = av_malloc_array(1, sizeof(*sc->stts_data));
54435442 if (!sc->stts_data)
54445443 return AVERROR(ENOMEM);
5444+ sc->stts_count = 1;
54455445 sc->stts_data[0].count = 1;
54465446 // Not used for still images. But needed by mov_build_index.
54475447 sc->stts_data[0].duration = 0;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t