diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 12:24:36 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-19 12:31:52 +0100 |
commit | 24af050c2fa9c28c85f68ac5425fc3fbaa826343 (patch) | |
tree | 6b04c400e4c819a13cb920df1acf0df810425c64 /libavformat/mov.c | |
parent | c89751aa218c22e2d0febcafba4b01c533b8836e (diff) | |
parent | 64f7575fbd64e5b65d5c644347408588c776f1fe (diff) | |
download | ffmpeg-24af050c2fa9c28c85f68ac5425fc3fbaa826343.tar.gz |
Merge commit '64f7575fbd64e5b65d5c644347408588c776f1fe'
* commit '64f7575fbd64e5b65d5c644347408588c776f1fe':
mov: avoid a memleak when multiple stss boxes are present
Conflicts:
libavformat/mov.c
See: 5ab882d7283f57560c889919c35f2688253b1d9c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 2ce6f9c664..4cfeb36dc6 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1972,7 +1972,9 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) } if (sc->keyframes) av_log(c->fc, AV_LOG_WARNING, "Duplicated STSS atom\n"); - av_free(sc->keyframes); + 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) |