From: Jerome Martinez <jerome@mediaarea.net> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] avformat/mxfenc: SMPTE RDD 48:2018 Amd 1:2022 (FFV1 in MXF) support Date: Tue, 4 Apr 2023 16:57:03 +0200 Message-ID: <4bcc6a3e-d0c8-f7ce-0620-7e9e9e745a5f@mediaarea.net> (raw) In-Reply-To: <20230404144355.GU1164690@pb2> [-- Attachment #1: Type: text/plain, Size: 878 bytes --] On 04/04/2023 16:43, Michael Niedermayer wrote: > On Mon, Apr 03, 2023 at 12:07:06AM +0200, Jerome Martinez wrote: >> On 02/04/2023 22:07, Michael Niedermayer wrote: >> >> + if (f->version == 4 && f->micro_version > 2) { >> + av_log(f->avctx, AV_LOG_ERROR, "unsupported version 4 micro_version %d\n", >> + f->micro_version); >> + return AVERROR_PATCHWELCOME; >> + } >> } >> f->ac = get_symbol(c, state, 0); > you do not know if the decoder will have any problem with these files But you don't don't if the decoder will have no problem, it seems safer to me to reject something we are not sure to support. Anyway, I don't really care (the decoder will just fail later if it is not compatible + it is explicitly flagged as experimental), attached is a version without the micro_version check. > [...] Jérôme [-- Attachment #2: 0001-avcodec-ffv1dec-reject-unsupported-ffv1-versions.patch --] [-- Type: text/plain, Size: 1613 bytes --] From dc0382709e548ef2514198bc866028066134d33e Mon Sep 17 00:00:00 2001 From: Jerome Martinez <jerome@mediaarea.net> Date: Mon, 3 Apr 2023 00:04:53 +0200 Subject: [PATCH] avcodec/ffv1dec: reject unsupported ffv1 versions And add similar check in libavformat/mxfenc --- libavcodec/ffv1dec.c | 5 +++++ libavformat/mxfenc.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 180d24e695..a3f9302233 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -439,6 +439,11 @@ static int read_extra_header(FFV1Context *f) av_log(f->avctx, AV_LOG_ERROR, "Invalid version in global header\n"); return AVERROR_INVALIDDATA; } + if (f->version > 4) { + av_log(f->avctx, AV_LOG_ERROR, "unsupported version %d\n", + f->version); + return AVERROR_PATCHWELCOME; + } if (f->version > 2) { c->bytestream_end -= 4; f->micro_version = get_symbol(c, state, 0); diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 0a1ae5353c..df5bb55ad8 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2493,6 +2493,10 @@ static int mxf_parse_ffv1_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt) av_log(s, AV_LOG_ERROR, "Invalid version in ffv1 global header\n"); return 0; } + if (v > 4) { + av_log(s, AV_LOG_ERROR, "unsupported ffv1 version %d\n", v); + return 0; + } sc->micro_version = get_ffv1_unsigned_symbol(&c, state); } else { uint8_t keystate = 128; -- 2.13.3.windows.1 [-- Attachment #3: Type: text/plain, Size: 251 bytes --] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-04-04 14:57 UTC|newest] Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-14 15:45 Jerome Martinez 2023-01-16 14:00 ` Tomas Härdin 2023-01-16 14:17 ` Jerome Martinez 2023-01-18 10:12 ` Tomas Härdin 2023-01-18 14:25 ` Jerome Martinez 2023-01-18 13:40 ` Tomas Härdin 2023-01-18 14:15 ` Jerome Martinez 2023-01-20 15:17 ` Tomas Härdin 2023-01-29 16:36 ` Dave Rice 2023-01-31 14:53 ` Tomas Härdin 2023-03-14 9:52 ` Jerome Martinez 2023-03-15 14:00 ` Tomas Härdin 2023-03-24 13:59 ` Dave Rice 2023-03-25 18:29 ` Tomas Härdin 2023-04-01 14:37 ` Michael Niedermayer 2023-04-01 15:20 ` Jerome Martinez 2023-04-01 15:43 ` Michael Niedermayer 2023-04-01 17:11 ` Jerome Martinez 2023-04-02 20:07 ` Michael Niedermayer 2023-04-02 22:07 ` Jerome Martinez 2023-04-04 14:43 ` Michael Niedermayer 2023-04-04 14:57 ` Jerome Martinez [this message] 2023-04-04 17:32 ` Michael Niedermayer 2023-04-04 21:37 ` Jerome Martinez 2023-04-05 12:31 ` Michael Niedermayer 2023-04-05 12:42 ` Michael Niedermayer
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=4bcc6a3e-d0c8-f7ce-0620-7e9e9e745a5f@mediaarea.net \ --to=jerome@mediaarea.net \ --cc=ffmpeg-devel@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