Skip to content

Commit 689e59b

Browse files
committed
mov: reset dref_count on realloc to keep values consistent.
This fixes a potential crash. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
1 parent 35e0496 commit 689e59b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: libavformat/mov.c

+1
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom)
401401
if (entries >= UINT_MAX / sizeof(*sc->drefs))
402402
return AVERROR_INVALIDDATA;
403403
av_free(sc->drefs);
404+
sc->drefs_count = 0;
404405
sc->drefs = av_mallocz(entries * sizeof(*sc->drefs));
405406
if (!sc->drefs)
406407
return AVERROR(ENOMEM);

0 commit comments

Comments
 (0)