summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorXiaohan Wang <xhwang@chromium.org>2018-02-13 14:45:14 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-09 02:39:21 +0100
commit3386be16d5131961f73c4227e9ddde4e3a5e39e3 (patch)
treef79d35fa338a56830b227675e25cd8a03fa13d2b /libavformat/mov.c
parent00035a6b4a9fcb4a9756fd4a3a01a196575e0d35 (diff)
ffmpeg: Fix stts_data memory allocation
In this loop, |i| is the "index". And the memory allocated should be at least the current "count", which is |i + 1|. BUG=801821 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7002a82787..ab03a99dc3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2859,7 +2859,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom)
for (i = 0; i < entries && !pb->eof_reached; i++) {
int sample_duration;
unsigned int sample_count;
- unsigned min_entries = FFMIN(FFMAX(i, 1024 * 1024), entries);
+ unsigned int min_entries = FFMIN(FFMAX(i + 1, 1024 * 1024), entries);
MOVStts *stts_data = av_fast_realloc(sc->stts_data, &alloc_size,
min_entries * sizeof(*sc->stts_data));
if (!stts_data) {