Commit 3386be16 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 00035a6b
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment