PR #25188 opened by thardin
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25188
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25188.patch

While it is likely that version 4 will follow the same pattern, there has been 
no update to Amendment 1.
Therefore we risk outputting broken files that the MXF community would have to 
deal with indefinitely.

# Summary of changes

Changes mxf_parse_ffv1_frame() so that FFv1 versions not listed in Amendment 1 
are rejected. I'm keeping the ULs listed in mxf_ffv1_codec_uls[] to hopefully 
encourage SMPTE to adopt the listed UL for FFv1 v4. Until they do, we shouldn't 
output potentially broken files.

See also #25055 and #25069


>From 75134e745d9bde3b0217767d532f9c24375155e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tomas=20H=C3=A4rdin?= <[email protected]>
Date: Fri, 16 Oct 2026 14:20:07 +0200
Subject: [PATCH] avformat/mxfenc: Only mux FFv1 versions listed in RDD 48
 Amendment 1

While it is likely that version 4 will follow the same pattern, there has been 
no update to Amendment 1.
Therefore we risk outputting broken files that the MXF community would have to 
deal with indefinitely.
---
 libavformat/mxfenc.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index fd303ac750..4af20d7350 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -271,7 +271,7 @@ static const UID mxf_ffv1_codec_uls[] = {
     { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x02,0x00 
}, // FFV1 version 1
     { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x03,0x00 
}, // FFV1 version 2 (was only experimental)
     { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x04,0x00 
}, // FFV1 version 3
-    { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x05,0x00 
}, // FFV1 version 4
+    { 
0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0D,0x04,0x01,0x02,0x02,0x03,0x09,0x05,0x00 
}, // FFV1 version 4 (not yet listed in Amendment 1)
 };
 
 static const uint8_t product_uid[]          = { 
0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd,0x00,0x0c,0x00,0x02};
@@ -2690,6 +2690,15 @@ static int mxf_parse_ffv1_frame(AVFormatContext *s, 
AVStream *st, AVPacket *pkt)
         if (v >= 2)
             return 0;
     }
+
+    // SMPTE RDD 48:2018 Amendment 1:2022 only defines mappings for versions 
0, 1 and 3. See section 1 and annex K.4.2.
+    // It is highly likely that version 4 will follow the same pattern, but it 
is not guaranteed.
+    // Therefore we refuse to mux anything not explicitly listed in Amendment 
1, unless it is updated in the future.
+    if (v != 0 && v != 1 && v != 3) {
+        av_log(s, AV_LOG_ERROR, "RDD 48 Amendment 1 only lists FFv1 versions 
0, 1 and 3, got %i\n", v);
+        return 0;
+    }
+
     sc->codec_ul = &mxf_ffv1_codec_uls[v];
     sc->sub_descriptor = FFV1SubDescriptor;
 
-- 
2.54.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to