diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-20 12:35:43 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-20 12:36:00 +0100 |
commit | ede5946b709513b84e12c6afd6f963e9304214f5 (patch) | |
tree | 449db5c8b1338c9201b33963443b892a16c644b1 | |
parent | 3cd2c33d36cb5cfe64ca43295f9e592de753f244 (diff) | |
parent | 931f5b235112f1c2a09dead36f0a228061d23942 (diff) | |
download | ffmpeg-ede5946b709513b84e12c6afd6f963e9304214f5.tar.gz |
Merge commit '931f5b235112f1c2a09dead36f0a228061d23942' into release/2.2
* commit '931f5b235112f1c2a09dead36f0a228061d23942':
mov: avoid a memleak when multiple stss boxes are present
Conflicts:
libavformat/mov.c
See: 5ab882d7283f57560c889919c35f2688253b1d9c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mov.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 6715d931ed..f0d095e1a1 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1801,8 +1801,10 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; } if (sc->keyframes) - av_log(c->fc, AV_LOG_WARNING, "Duplicate STSS atom\n"); - av_free(sc->keyframes); + av_log(c->fc, AV_LOG_WARNING, "Duplicated STSS atom\n"); + if (entries >= UINT_MAX / sizeof(int)) + return AVERROR_INVALIDDATA; + av_freep(&sc->keyframes); sc->keyframe_count = 0; sc->keyframes = av_malloc_array(entries, sizeof(*sc->keyframes)); if (!sc->keyframes) |