mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-05 06:40:03 +00:00
mov: reset dref_count on realloc to keep values consistent.
This fixes a potential crash. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
35e0496a7b
commit
689e59b7ff
@ -401,6 +401,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
if (entries >= UINT_MAX / sizeof(*sc->drefs))
|
if (entries >= UINT_MAX / sizeof(*sc->drefs))
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
av_free(sc->drefs);
|
av_free(sc->drefs);
|
||||||
|
sc->drefs_count = 0;
|
||||||
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
|
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
|
||||||
if (!sc->drefs)
|
if (!sc->drefs)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
Reference in New Issue
Block a user