summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-03-25 14:16:35 -0300
committerJames Almer <jamrial@gmail.com>2020-03-26 11:46:08 -0300
commit59c993e227cd0460513d3eeaf17cc34dff33019e (patch)
tree3fe2b3913fdaf1681d39bf85c756536e17e1a2cb
parente4dd8ee3233634a7656d53f64bdfec37a501f38e (diff)
avformat/movenc: Reduce size of the allocated MOVIentry array
Increasing it by 2048 entries per realloc is exessive. Reduces memory usage, especially on long, non fragmented output. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/movenc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 85df5d1374..ce82acf914 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5559,7 +5559,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
}
if (trk->entry >= trk->cluster_capacity) {
- unsigned new_capacity = 2 * (trk->entry + MOV_INDEX_CLUSTER_SIZE);
+ unsigned new_capacity = trk->entry + MOV_INDEX_CLUSTER_SIZE;
if (av_reallocp_array(&trk->cluster, new_capacity,
sizeof(*trk->cluster))) {
ret = AVERROR(ENOMEM);