mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-04 11:38:19 +00:00
mov: Do not allow updating the time scale after it has been set
The time scale is set in mdhd, and later validated in the
enclosing trak atom once all of its children have been parsed.
A loose mdhd atom outside of a trak atom could update the time
scale of the last stream without any validation.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Cc: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 31931520df
)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
parent
729143e2d2
commit
a593d2e92e
@ -736,6 +736,11 @@ static int mov_read_mdhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
st = c->fc->streams[c->fc->nb_streams-1];
|
||||
sc = st->priv_data;
|
||||
|
||||
if (sc->time_scale) {
|
||||
av_log(c->fc, AV_LOG_ERROR, "Multiple mdhd?\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
version = avio_r8(pb);
|
||||
if (version > 1) {
|
||||
av_log_ask_for_sample(c, "unsupported version %d\n", version);
|
||||
|
Loading…
Reference in New Issue
Block a user