mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 11:49:48 +00:00
mov: fix leaking memory with multiple drefs.
Instead of allocating over the original, free first. MOVStreamContext is zero initialized so no double free will occur. Same style as other fixes for the same problem in this file. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
7f77e9041a
commit
4ebd422c04
@ -387,6 +387,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
entries = avio_rb32(pb);
|
||||
if (entries >= UINT_MAX / sizeof(*sc->drefs))
|
||||
return AVERROR_INVALIDDATA;
|
||||
av_free(sc->drefs);
|
||||
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
|
||||
if (!sc->drefs)
|
||||
return AVERROR(ENOMEM);
|
||||
|
Loading…
Reference in New Issue
Block a user