[FFmpeg-devel] [PATCH] avformat/options_table: Set the default maximum number of streams to 100

Hendrik Leppkes h.leppkes at gmail.com
Sun Dec 11 16:29:32 EET 2016


On Sat, Dec 10, 2016 at 11:36 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
>
> On Sat, Dec 10, 2016 at 5:24 PM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
> wrote:
>
>> 2016-12-10 14:07 GMT+01:00 Ronald S. Bultje <rsbultje at gmail.com>:
>> > Hi,
>> >
>> > On Sat, Dec 10, 2016 at 7:11 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com>
>> > wrote:
>> >
>> >> 2016-12-09 12:56 GMT+01:00 Ronald S. Bultje <rsbultje at gmail.com>:
>> >>
>> >> > On IRC, we discussed at what values OOM start occurring, which
>> >> > seems to be around 30k-60k
>> >>
>> >> This is not true, why do you think so?
>> >
>> > http://lists.ffmpeg.org/pipermail/ffmpeg-devel-irc/
>> 2016-December/003980.html
>>
>> http://www.openwall.com/lists/oss-security/2016/12/08/1
>> Iiuc (which isn't sure at all) this is about 26000 streams.
>
>
> And how does that fundamentally change the discussion? The question was
> about orders of magnitude (think powers of 10), so you just changes the
> answer from log10(30k)=4.48 to log10(26k)=4.41. In both cases, a sensible
> limit is something like exp10(3) or exp10(4), but exp10(2) is not necessary
> IMHO,
>

If we must have a pre-defined limit (which I still find a questionable
choice to limit resource usage in general, OOM itself is not an
inherently "evil" thing, perfectly valid files could cause OOM just
due to sheer size and if OOM is a crash then something else needs
fixing to check mallocs), then 1000 (ie. exp10(3)) (or 1024 because we
like power of 2 numbers) is probably going to be enough for all sorts
of valid files. Even odd mpegts files with loads of empty streams in
empty programs would never reach that.

- Hendrik


More information about the ffmpeg-devel mailing list