From 0734d1c55aedaf2df4a51488f9b75e42daf9f707 Mon Sep 17 00:00:00 2001 From: Zhao Zhili Date: Tue, 28 Oct 2025 15:43:46 +0800 Subject: [PATCH] avformat/mov: relax check on proj box size Pico VR adds a '\0' after projection_type (a real C string than a fourcc). It's not strictly correct, but doesn't affect parsing. [prji: Projection Information Box] position = 149574743 size = 17 version = 0 flags = 0x000000 projection_type = rect Co-Authored-by: Keven Ma Signed-off-by: Zhao Zhili --- libavformat/mov.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 42062e6ba6..d08fd01054 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -6853,15 +6853,17 @@ static int mov_read_vexu_proj(MOVContext *c, AVIOContext *pb, MOVAtom atom) st = c->fc->streams[c->fc->nb_streams - 1]; sc = st->priv_data; - if (atom.size != 16) { + if (atom.size < 16) { av_log(c->fc, AV_LOG_ERROR, "Invalid size for proj box: %"PRIu64"\n", atom.size); return AVERROR_INVALIDDATA; } size = avio_rb32(pb); - if (size != 16) { + if (size < 16) { av_log(c->fc, AV_LOG_ERROR, "Invalid size for prji box: %d\n", size); return AVERROR_INVALIDDATA; + } else if (size > 16) { + av_log(c->fc, AV_LOG_WARNING, "Box has more bytes (%d) than prji box required (16) \n", size); } tag = avio_rl32(pb);