diff options
author | Martin Storsjö <martin@martin.st> | 2014-01-13 14:46:07 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2014-01-15 09:57:38 +0200 |
commit | 2620df13104ddaa136158eb6bb1195adbf9d7692 (patch) | |
tree | 30aced5c1eeae06eb4dc9bf1f7e85f7f2725824a /libavformat/mov.c | |
parent | d51f09962d5b4bc999fb70c040f330dd1873212e (diff) |
mov: Free an earlier allocated array if allocating a new one
It could probably also be considered an error if the pointer isn't
null at this point, but then we might risk rejecting some
slightly broken files that we might have handled so far.
Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index b7823bf2f6..b5019f5863 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1717,6 +1717,7 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (entries >= UINT_MAX / sizeof(*sc->stts_data)) return AVERROR(EINVAL); + av_free(sc->stts_data); sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data)); if (!sc->stts_data) return AVERROR(ENOMEM); |