Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: James Almer <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avformat/mov: don't parse reserved ISOBMFF fields as if they were QT (PR #20993)
Date: Fri, 21 Nov 2025 20:00:20 -0000
Message-ID: <176375522112.59.11997145513178747834@2cb04c0e5124> (raw)

PR #20993 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20993
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20993.patch


>From 79823311f5ac847b7a85319b7814959bc84d89a7 Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Fri, 21 Nov 2025 16:58:13 -0300
Subject: [PATCH] avformat/mov: don't parse reserved ISOBMFF fields as if they
 were QT

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/mov.c                             | 10 ++++++++++
 tests/ref/fate/mov-mp4-iamf-5_1_4             |  2 --
 tests/ref/fate/mov-mp4-iamf-7_1_4-video-first |  2 --
 tests/ref/fate/mov-mp4-iamf-7_1_4-video-last  |  2 --
 tests/ref/fate/mov-mp4-iamf-ambisonic_1       |  2 --
 tests/ref/fate/mov-mp4-iamf-stereo            |  2 --
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index eab9f79577..a3e1ba0a31 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2678,12 +2678,18 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
      * read in ff_mov_read_stsd_entries() */
     stsd_start = avio_tell(pb) - 16;
 
+    if (c->isom) {
+        avio_skip(pb, 2);  /* pre_defined */
+        avio_skip(pb, 2);  /* reserved */
+        avio_skip(pb, 12); /* pre_defined */
+    } else {
     avio_rb16(pb); /* version */
     avio_rb16(pb); /* revision level */
     id = avio_rl32(pb); /* vendor */
     av_dict_set(&st->metadata, "vendor_id", av_fourcc2str(id), 0);
     avio_rb32(pb); /* temporal quality */
     avio_rb32(pb); /* spatial quality */
+    }
 
     st->codecpar->width  = avio_rb16(pb); /* width */
     st->codecpar->height = avio_rb16(pb); /* height */
@@ -2733,9 +2739,13 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
     AVDictionaryEntry *compatible_brands = av_dict_get(c->fc->metadata, "compatible_brands", NULL, AV_DICT_MATCH_CASE);
     int channel_count;
 
+    if (c->isom)
+        avio_skip(pb, 6); /* reserved */
+    else {
     avio_rb16(pb); /* revision level */
     id = avio_rl32(pb); /* vendor */
     av_dict_set(&st->metadata, "vendor_id", av_fourcc2str(id), 0);
+    }
 
     channel_count = avio_rb16(pb);
 
diff --git a/tests/ref/fate/mov-mp4-iamf-5_1_4 b/tests/ref/fate/mov-mp4-iamf-5_1_4
index 18a1f5337f..9eaa5ee42d 100644
--- a/tests/ref/fate/mov-mp4-iamf-5_1_4
+++ b/tests/ref/fate/mov-mp4-iamf-5_1_4
@@ -160,7 +160,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x0
@@ -395,7 +394,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x0
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first
index d5a1fe1cad..55cadb3d02 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-first
@@ -207,7 +207,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=1
 id=0x2
@@ -465,7 +464,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=1
 id=0x2
diff --git a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last
index caf89d41f6..80c924c821 100644
--- a/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last
+++ b/tests/ref/fate/mov-mp4-iamf-7_1_4-video-last
@@ -207,7 +207,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x9
@@ -465,7 +464,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x9
diff --git a/tests/ref/fate/mov-mp4-iamf-ambisonic_1 b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
index d0877f73c7..b6f14099c3 100644
--- a/tests/ref/fate/mov-mp4-iamf-ambisonic_1
+++ b/tests/ref/fate/mov-mp4-iamf-ambisonic_1
@@ -99,7 +99,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x0
@@ -264,7 +263,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x0
diff --git a/tests/ref/fate/mov-mp4-iamf-stereo b/tests/ref/fate/mov-mp4-iamf-stereo
index ca8f6a76f5..85e6e3efbb 100644
--- a/tests/ref/fate/mov-mp4-iamf-stereo
+++ b/tests/ref/fate/mov-mp4-iamf-stereo
@@ -52,7 +52,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x0
@@ -187,7 +186,6 @@ DISPOSITION:still_image=0
 DISPOSITION:multilayer=0
 TAG:language=und
 TAG:handler_name=SoundHandler
-TAG:vendor_id=[0][0][0][0]
 [STREAM]
 index=0
 id=0x0
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-11-21 20:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176375522112.59.11997145513178747834@2cb04c0e5124 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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