[FFmpeg-devel] [FFFjo] Re: [FFmpeg/FFmpeg] avformat/mxfenc: Ensure frame offset in valid range (PR #20020)
cus
code at ffmpeg.org
Thu Jul 24 02:00:27 EEST 2025
*@cus* commented on this pull request.
Otherwise looks good.
In libavformat/mxfenc.c:
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1985,2 +1985,3 @@
-static void mxf_write_index_table_segment(AVFormatContext *s)
+static inline int mxf_check_frame_offset(AVFormatContext *s, int offset)
+{
Why inline? It just feels a bit strange, but does not matter too much I guess.
In libavformat/mxfenc.c:
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1987,0 +1990,4 @@
+
+ av_log(s, AV_LOG_ERROR, "frame offset %d out of range [%d,%d], please reduce "
+ "encoder GOP size\n", offset, INT8_MIN, INT8_MAX);
+ return AVERROR_INVALIDDATA;
Maybe AVERROR_PATCHWELCOME and some modification of the message that this is not supported? Because MXF in theory could handle this more gracefully by writing sparse index tables or not writing an index table at all.
---
View it on FFmpeg Forgejo ( https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20020#issuecomment-364 ) or reply to this email directly.
More information about the ffmpeg-devel
mailing list