ffmpeg | branch: master | Derek Buitenhuis <derek.buitenh...@gmail.com> | Wed Apr 13 17:30:42 2016 +0100| [bdd6275691dc8819bde083533943154c4204a768] | committer: Derek Buitenhuis
Merge commit '7e01d48cfd168c3dfc663f03a3b6a98e0ecba328' * commit '7e01d48cfd168c3dfc663f03a3b6a98e0ecba328': mov: Check the entries value when parsing dref boxes Merged-by: Derek Buitenhuis <derek.buitenh...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bdd6275691dc8819bde083533943154c4204a768 --- libavformat/mov.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 73bff09..42f8834 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -515,9 +515,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_count = 0; sc->drefs = av_mallocz(entries * sizeof(*sc->drefs)); ====================================================================== diff --cc libavformat/mov.c index 73bff09,9d271f8..42f8834 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@@ -515,11 -473,12 +515,13 @@@ static int mov_read_dref(MOVContext *c 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_count = 0; sc->drefs = av_mallocz(entries * sizeof(*sc->drefs)); if (!sc->drefs) return AVERROR(ENOMEM); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog