avformat/mov: check extradata in mov_read_dops()

We do want to limit an attackers ability to change once parsed structures.
So once extradata (or another array) is finished and possibly has been used we do not
want to allow an attacker to change it.

This reduces the attack surface

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-04-29 01:49:59 +02:00
committed by michaelni
parent 53cd2c9f2a
commit 7c67748537

View File

@@ -8573,7 +8573,7 @@ static int mov_read_dops(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return 0;
st = c->fc->streams[c->fc->nb_streams-1];
if ((uint64_t)atom.size > (1<<30) || atom.size < 11)
if ((uint64_t)atom.size > (1<<30) || atom.size < 11 || st->codecpar->extradata)
return AVERROR_INVALIDDATA;
/* Check OpusSpecificBox version. */