[FFmpeg-devel] [PATCH] Stricter TMV probe

Vitor Sessak vitor1001
Mon Sep 14 22:30:13 CEST 2009

Reimar D?ffinger wrote:
> On Mon, Sep 14, 2009 at 04:05:34PM -0400, Ronald S. Bultje wrote:
>> Hi,
>> On Mon, Sep 14, 2009 at 3:51 PM, Reimar D?ffinger
>> <Reimar.Doeffinger at gmx.de> wrote:
>>> Not really related to this specific patch, just because every probe
>>> function checks sample_rate:
>>> A lot of demuxers (including that one) do not validate it in
>>> read_header, ending up with 1/0 as time base. That really is not ok (and
>>> as said, I have the impression a lot of demuxers do that).
>> I think just checking for != 0 isn't enough. A samplerate of 1 might
>> be valid, but isn't. I mean, it wouldn't produce anything audible. A
>> min. samplerate of e.g. 1000 seems appropriate, and for many gaming
>> formats, a max of e.g. 192000 might also be useful.
>> Similar restrictions might apply to other properties.
> Checking for != 0 is certainly enough to avoid division by 0

I don't think the probing code is the best place to avoid crashes later 
(think about someone correctly forcing the format for a broken file)...


More information about the ffmpeg-devel mailing list