diff options
author | Alexandra Khirnova <alexandra.khirnova@gmail.com> | 2013-09-12 11:49:38 +0400 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-09-12 15:16:15 +0400 |
commit | 00a63bfb87af6cf7bcdf85848830a90c7e052d41 (patch) | |
tree | b991b16d1908b7fdd1324c28feb68c9402db2931 | |
parent | c0779a67e85df856904ee6fab760c4233d4c2be5 (diff) |
matroskaenc: Fix stray pointers left over from av_reallocp_array refactoring
Signed-off-by: Diego Biurrun <diego@biurrun.de>
-rw-r--r-- | libavformat/matroskaenc.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 86baa65503..f3a35f8986 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -294,23 +294,21 @@ static mkv_seekhead * mkv_start_seekhead(AVIOContext *pb, int64_t segment_offset static int mkv_add_seekhead_entry(mkv_seekhead *seekhead, unsigned int elementid, uint64_t filepos) { - mkv_seekhead_entry *entries = seekhead->entries; int err; // don't store more elements than we reserved space for if (seekhead->max_entries > 0 && seekhead->max_entries <= seekhead->num_entries) return -1; - if ((err = av_reallocp_array(&entries, seekhead->num_entries + 1, - sizeof(*entries))) < 0) { + if ((err = av_reallocp_array(&seekhead->entries, seekhead->num_entries + 1, + sizeof(*seekhead->entries))) < 0) { seekhead->num_entries = 0; return err; } - entries[seekhead->num_entries ].elementid = elementid; - entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset; + seekhead->entries[seekhead->num_entries].elementid = elementid; + seekhead->entries[seekhead->num_entries++].segmentpos = filepos - seekhead->segment_offset; - seekhead->entries = entries; return 0; } @@ -379,23 +377,21 @@ static mkv_cues * mkv_start_cues(int64_t segment_offset) static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos) { - mkv_cuepoint *entries = cues->entries; int err; if (ts < 0) return 0; - if ((err = av_reallocp_array(&entries, cues->num_entries + 1, - sizeof(*entries))) < 0) { + if ((err = av_reallocp_array(&cues->entries, cues->num_entries + 1, + sizeof(*cues->entries))) < 0) { cues->num_entries = 0; return err; } - entries[cues->num_entries ].pts = ts; - entries[cues->num_entries ].tracknum = stream + 1; - entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset; + cues->entries[cues->num_entries].pts = ts; + cues->entries[cues->num_entries].tracknum = stream + 1; + cues->entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset; - cues->entries = entries; return 0; } |