提交 64f7575f 编写于 作者: A Anton Khirnov

mov: avoid a memleak when multiple stss boxes are present

CC: libav-stable@libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
上级 210461c0
...@@ -1819,6 +1819,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -1819,6 +1819,7 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom)
} }
if (entries >= UINT_MAX / sizeof(int)) if (entries >= UINT_MAX / sizeof(int))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
av_freep(&sc->keyframes);
sc->keyframes = av_malloc(entries * sizeof(int)); sc->keyframes = av_malloc(entries * sizeof(int));
if (!sc->keyframes) if (!sc->keyframes)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册