summaryrefslogtreecommitdiff
path: root/tests/ref/fate/aac-autobsf-adtstoasc
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2019-12-29 09:38:44 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-03-26 03:19:56 +0100
commitdc2f6b54ac85189185938c10a168a647f1da1f62 (patch)
treedc7adabb0f4c40af4f9ee970f138937b1ac3e652 /tests/ref/fate/aac-autobsf-adtstoasc
parent107783006ca84781ac027f7f5c9023fbd6cde422 (diff)
avformat/matroskaenc: Avoid allocations for SeekHead
Up until e7ddafd5, the Matroska muxer wrote two SeekHeads: One at the beginning referencing the main level 1 elements (i.e. not the Clusters) and one at the end, referencing the Clusters. This second SeekHead was useless and has therefore been removed. Yet the SeekHead-related functions and structures are still geared towards this usecase: They are built around an allocated array of variable size that gets reallocated every time an element is added to it although the maximum number of Seek entries is a small compile-time constant, so that one should rather include the array in the SeekHead structure itself; and said structure should be contained in the MatroskaMuxContext instead of being allocated separately. The earlier code reserved space for a SeekHead with 10 entries, although we currently write at most 6. Reducing said number implied that every Matroska/Webm file will be 84 bytes smaller and required to adapt several FATE tests; furthermore, the reserved amount overestimated the amount needed for for the SeekHead's length field and how many bytes need to be reserved to write a EBML Void element, bringing the total reduction to 89 bytes. This also fixes a potential segfault: If !mkv->is_live and if the AVIOContext is initially unseekable when writing the header, the SeekHead is already written when writing the header and this used to free the SeekHead-related structures that have been allocated. But if the AVIOContext happens to be seekable when writing the trailer, it will be attempted to write the SeekHead again which will lead to segfaults because the corresponding structures have already been freed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'tests/ref/fate/aac-autobsf-adtstoasc')
-rw-r--r--tests/ref/fate/aac-autobsf-adtstoasc4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ref/fate/aac-autobsf-adtstoasc b/tests/ref/fate/aac-autobsf-adtstoasc
index 9bf9dfe78f..45b68b62bd 100644
--- a/tests/ref/fate/aac-autobsf-adtstoasc
+++ b/tests/ref/fate/aac-autobsf-adtstoasc
@@ -1,5 +1,5 @@
-b09fc2f554712adbf84fe7899eb679d4 *tests/data/fate/aac-autobsf-adtstoasc.matroska
-6695 tests/data/fate/aac-autobsf-adtstoasc.matroska
+d10b73732b32f6b2f08885b40c41c77f *tests/data/fate/aac-autobsf-adtstoasc.matroska
+6606 tests/data/fate/aac-autobsf-adtstoasc.matroska
#extradata 0: 2, 0x0030001c
#tb 0: 1/1000
#media_type 0: audio