Commit 689e59b7 authored by Michael Niedermayer's avatar Michael Niedermayer

mov: reset dref_count on realloc to keep values consistent.

This fixes a potential crash.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 35e0496a
......@@ -401,6 +401,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
if (entries >= UINT_MAX / sizeof(*sc->drefs))
return AVERROR_INVALIDDATA;
av_free(sc->drefs);
sc->drefs_count = 0;
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
if (!sc->drefs)
return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment