Skip to content
Permalink
Browse files Browse the repository at this point in the history
mov: reset dref_count on realloc to keep values consistent.
This fixes a potential crash.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Apr 15, 2012
1 parent 35e0496 commit 689e59b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libavformat/mov.c
Expand Up @@ -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);
Expand Down

0 comments on commit 689e59b

Please sign in to comment.