diff --git a/libavformat/mov.c b/libavformat/mov.c index 3734689fd1..9077b7d042 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1702,6 +1702,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) } if (entries >= UINT_MAX / sizeof(int)) return AVERROR_INVALIDDATA; + av_freep(&sc->keyframes); sc->keyframes = av_malloc(entries * sizeof(int)); if (!sc->keyframes) return AVERROR(ENOMEM);