mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-06 23:31:13 +00:00
Merge commit '7e01d48cfd168c3dfc663f03a3b6a98e0ecba328'
* commit '7e01d48cfd168c3dfc663f03a3b6a98e0ecba328': mov: Check the entries value when parsing dref boxes Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
commit
bdd6275691
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user