[FFmpeg-cvslog] mov: Do not allow updating the time scale after it has been set
Martin Storsjö
git at videolan.org
Tue Aug 27 18:38:48 CEST 2013
ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Mon Jul 15 17:13:54 2013 +0300| [7e9debb083d95db6601224ac13a4e7419528d03b] | committer: Luca Barbato
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 at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 31931520df35a6f9606fe8293c8a39e2d1fabedf)
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e9debb083d95db6601224ac13a4e7419528d03b
---
libavformat/mov.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 52b73a9..f652934 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -716,6 +716,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->fc, "unsupported version %d\n", version);
More information about the ffmpeg-cvslog
mailing list