Message ID | 20160311135004.A14D65DAD2@aruru.libav.org |
---|---|
State | New |
Headers | show |
diff --git a/libavformat/mov.c b/libavformat/mov.c index a556aa7..9d271f8 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -473,9 +473,11 @@ static int mov_read_dref(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb32(pb); // version + flags entries = avio_rb32(pb); - if (entries > (atom.size - 1) / MIN_DATA_ENTRY_BOX_SIZE + 1 || + if (!entries || + entries > (atom.size - 1) / MIN_DATA_ENTRY_BOX_SIZE + 1 || entries >= UINT_MAX / sizeof(*sc->drefs)) return AVERROR_INVALIDDATA; + sc->drefs_count = 0; av_free(sc->drefs); sc->drefs = av_mallocz(entries * sizeof(*sc->drefs)); if (!sc->drefs)