mov: avoid a memleak when multiple stss boxes are present
CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind (cherry picked from commit64f7575fbd) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit577f1feb3f) Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
@@ -1598,6 +1598,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);
|
||||||
|
|||||||
Reference in New Issue
Block a user