* [FFmpeg-devel] [PATCH] [release/8.0] avformat/mov: fix missing video size and relax check on proj box size (PR #20977)
@ 2025-11-20 3:27 Zhao Zhili via ffmpeg-devel
0 siblings, 0 replies; only message in thread
From: Zhao Zhili via ffmpeg-devel @ 2025-11-20 3:27 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
PR #20977 opened by Zhao Zhili (quink)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20977
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20977.patch
>From 70e3fbb6484c171d0fa3b6d466865adc2c7332e6 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <zhilizhao@tencent.com>
Date: Tue, 28 Oct 2025 15:43:46 +0800
Subject: [PATCH 1/2] 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 <zhilizhao@tencent.com>
(cherry picked from commit 0734d1c55aedaf2df4a51488f9b75e42daf9f707)
---
libavformat/mov.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index b29c41a6b6..ea95d75155 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6844,15 +6844,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);
--
2.49.1
>From fa959739bfd391b37f6400cd2f84405896d086d3 Mon Sep 17 00:00:00 2001
From: Zhao Zhili <zhilizhao@tencent.com>
Date: Wed, 8 Oct 2025 23:31:11 +0800
Subject: [PATCH 2/2] avformat/mov: fix missing video size when some decoders
are disabled
Fix #20667
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
(cherry picked from commit 6b961f5963d8e362137702d38a744b45fba8ba3a)
---
libavformat/mov.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index ea95d75155..f3945c2be2 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5242,16 +5242,22 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
#endif
}
+#if CONFIG_H261_DECODER || CONFIG_H263_DECODER || CONFIG_MPEG4_DECODER
switch (st->codecpar->codec_id) {
+#if CONFIG_H261_DECODER
case AV_CODEC_ID_H261:
+#endif
+#if CONFIG_H263_DECODER
case AV_CODEC_ID_H263:
+#endif
+#if CONFIG_MPEG4_DECODER
case AV_CODEC_ID_MPEG4:
+#endif
st->codecpar->width = 0; /* let decoder init width/height */
st->codecpar->height= 0;
break;
- default:
- break;
}
+#endif
// If the duration of the mp3 packets is not constant, then they could need a parser
if (st->codecpar->codec_id == AV_CODEC_ID_MP3
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-11-20 3:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-20 3:27 [FFmpeg-devel] [PATCH] [release/8.0] avformat/mov: fix missing video size and relax check on proj box size (PR #20977) Zhao Zhili via ffmpeg-devel
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git