diff --git a/libavformat/mov.c b/libavformat/mov.c index 6c5caa7d04..d6427b3574 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5468,7 +5468,7 @@ static int mov_read_mdcv(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc = c->fc->streams[c->fc->nb_streams - 1]->priv_data; - if (atom.size < 24) { + if (atom.size < 24 || sc->mastering) { av_log(c->fc, AV_LOG_ERROR, "Invalid Mastering Display Color Volume box\n"); return AVERROR_INVALIDDATA; }