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

# Summary of changes

Fixes: https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/25055

Fixes issue due to MXF muxer writing FFV1Version by copying byte 14 of the FFV1 
codec label.
This caused incorrect version numbers, it would increase by one, so 3 became 4.
Now we save the real version in sc->version.

<!--
If this PR requires new FATE test samples, attach them to the PR and
list their target paths below (relative to the fate-suite root).

Attached filenames must match the sample's filename:

```fate-samples
# e.g. vorbis/new-sample.ogg
```
-->



>From a946a072f33a3ec104b446410076d612effde5c4 Mon Sep 17 00:00:00 2001
From: ykisana <[email protected]>
Date: Wed, 14 Oct 2026 10:24:36 -0600
Subject: [PATCH] avformat/mxfenc: write the actual FFV1 version in the FFV1
 sub-descriptor

Fixes issue due to MXF muxer writing FFV1Version by copying byte 14 of the FFV1 
codec label.
This caused incorrect version numbers, it would increase by one, so 3 became 4.
Now we save the real version in sc->version.
---
 libavformat/mxfenc.c    | 4 +++-
 tests/ref/lavf/mxf_ffv1 | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 37b62dbd2b..ec8634a784 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -118,6 +118,7 @@ typedef struct MXFStreamContext {
     int max_gop;             ///< maximum gop size, used by mpeg-2 descriptor
     int b_picture_count;     ///< maximum number of consecutive b pictures, 
used in mpeg-2 descriptor
     int low_delay;           ///< low delay, used in mpeg-2 descriptor
+    int version;             ///< format version, used in ffv1 descriptor
     int micro_version;       ///< format micro_version, used in ffv1 descriptor
     j2k_info_t j2k_info;
     enum MXFMetadataSetType sub_descriptor;
@@ -1633,7 +1634,7 @@ static void mxf_write_ffv1_subdesc(AVFormatContext *s, 
AVStream *st)
     }
 
     mxf_write_local_tag(s, 2, 0xDFDA);
-    avio_wb16(pb, (*sc->codec_ul)[14]); // FFV1Version
+    avio_wb16(pb, sc->version); // FFV1Version
 
     if (st->codecpar->extradata_size) {
         mxf_write_local_tag(s, 2, 0xDFD9);
@@ -2690,6 +2691,7 @@ static int mxf_parse_ffv1_frame(AVFormatContext *s, 
AVStream *st, AVPacket *pkt)
         v = get_ffv1_unsigned_symbol(&c, state);
         av_assert0(v < 2);
     }
+    sc->version = v;
     sc->codec_ul = &mxf_ffv1_codec_uls[v];
     sc->sub_descriptor = FFV1SubDescriptor;
 
diff --git a/tests/ref/lavf/mxf_ffv1 b/tests/ref/lavf/mxf_ffv1
index b89e6a214e..4ae93b2e89 100644
--- a/tests/ref/lavf/mxf_ffv1
+++ b/tests/ref/lavf/mxf_ffv1
@@ -1,3 +1,3 @@
-0426b93bbf06aedf083f00cd4ebaf36f *tests/data/lavf/lavf.mxf_ffv1
+67638015788bb7dfcc1c16183967b513 *tests/data/lavf/lavf.mxf_ffv1
 5587001 tests/data/lavf/lavf.mxf_ffv1
 tests/data/lavf/lavf.mxf_ffv1 CRC=0x02354cdc
-- 
2.52.0

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

Reply via email to