diff --git a/libavformat/mov.c b/libavformat/mov.c index 4590a2de746bb8c3a2ef449dc7c0b27bb9832620..aa81661c9acf7e412eac73cf17c42b5cc403511a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1819,6 +1819,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);