From: Marton Balint <cus@passwd.hu>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] Revert "avformat/mov: disallow a zero sample size in trun atoms"
Date: Mon, 5 Dec 2022 01:16:25 +0100 (CET)
Message-ID: <df96ee82-5de8-c0ff-c4a-3df6ce6df8fe@passwd.hu> (raw)
In-Reply-To: <c758ed1e-cfd5-b4af-f72e-167b66013311@gyani.pro>
On Fri, 2 Dec 2022, Gyan Doshi wrote:
>
>
> On 2022-12-02 06:16 am, Chris Ribble wrote:
>> On Thu, Dec 1, 2022 at 4:51 PM Marton Balint <cus@passwd.hu> wrote:
>>> Can you explain why those files are considered valid, or why it makes
>>> sense to generate such files?
>>>
>>> Thanks,
>>> Marton
>>>
>> As far as I can tell, the file that a user provided with this problem
>> was generated by an encoder (running FFmpeg 3.4) that started writing
>> zero-sized samples when their video switcher + capture card stopped
>> receiving audio input. I'm not arguing that it's good for files to be
>> generated like this, but it's nice for FFmpeg to be able to process
>> them all the same (i.e. the robustness principle).
>>
>> With this patch reverted, FFmpeg can accept an input file that is
>> partially broken (with playback anomalies due to the presence of
>> zero-sized samples) and produce a valid, working output mp4 (or DASH
>> stream), just like it could in release 5.0 and older.
>>
>> One of the best things about FFmpeg is that it can fix invalid
>> container metadata. I feel like losing that capability for this
>> scenario is a regression.
>
> FWIW, we don't discard regular MP4s with sample entries of 0 in stts, which
> is only permitted for the last solo sample in a track. So, I agree.
More strict enforcement of sample size was introduced to avoid DOS/Timeout
with crafted (fuzzed) files and disallow emitting zero sized packets.
Invalid file support is not something that is always worth doing, there
are other, more important factors, like limiting code complexity or
improving resiliance against denial of service. The problem here is that I
honestly don't know if a zero sample size is against spec, just stupid, or
there is a legitimate use for it.
So I sent a 2 patch series which fixes the original issue differently.
Please test and review them if you can.
Thanks,
Marton
_______________________________________________
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:[~2022-12-05 0:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-01 21:40 Chris Ribble
2022-12-01 22:51 ` Marton Balint
2022-12-02 0:46 ` Chris Ribble
2022-12-02 4:11 ` Gyan Doshi
2022-12-05 0:16 ` Marton Balint [this message]
2022-12-05 1:38 ` Chris Ribble
2022-12-05 18:04 ` Marton Balint
2022-12-06 7:28 ` Chris Ribble
2022-12-11 11:53 ` Marton Balint
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=df96ee82-5de8-c0ff-c4a-3df6ce6df8fe@passwd.hu \
--to=cus@passwd.hu \
--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