diff --git a/libavformat/mov.c b/libavformat/mov.c index 987b0c0496..b52a72fe30 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5341,6 +5341,9 @@ static int mov_read_smdm(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_WARNING, "Unsupported Mastering Display Metadata box version %d\n", version); return 0; } + if (sc->mastering) + return AVERROR_INVALIDDATA; + avio_skip(pb, 3); /* flags */ sc->mastering = av_mastering_display_metadata_alloc();