[FFmpeg-devel] [PATCH]lavf/swfdec: Reduce score when auto-detecting swf files

Michael Niedermayer michael at niedermayer.cc
Sat Jan 20 00:42:46 EET 2018


On Fri, Jan 19, 2018 at 07:25:43PM +0100, Carl Eugen Hoyos wrote:
> 2018-01-19 18:51 GMT+01:00 Michael Niedermayer <michael at niedermayer.cc>:
> > On Thu, Jan 18, 2018 at 09:28:40PM +0100, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> The probe score for swf files (with uncompressed headers) is currently
> >> very high after testing a little more than 24bit, attached patch
> >> reduces the score.
> >
> > hmm
> > the first 24 bits are tested and all but 2 values are rejected
> >
> > thats 23 bits that must match
> 
> Ok.
> 
> > then 4 values are tested which can be from 1 to 31 bits each
> > the tests are each either == 0 or != 0 so they are a bit weak
> > but its at least adding 4 bits that must match and also len
> 
> I was sure this is not equivalent to four bits on a specific
> position (but for the patch I assumed a "best case scenario"
> where this actually were the case).
> 
> > itself has to be smallish so we could argue that this gets us to
> > about 28 bits
> 
> > and then buf[3] is checked to be < 20
> > at this point we need about 32bits to be matching, still not huge but
> > id think this is stronger than what file extensions prove which are
> > MAX/2
> 
> We return MAX/2 for many "initial 32 bits" tests and I believe
> we made good experience (and for MAX/2 the extension is
> ignored or do I misremember?)
> 

> > The test is weakened by using 0 / not 0 / ascii as values though
> >
> > Have you seen an actual probe failure ?
> 
> No, I was looking at another issue.

we have many files with wrong extensions, its not uncommon

so if we have no example of this failing then it is clearly
a stronger check than file extension checking which is at score 50
so the score should be higher

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180119/eb9782c2/attachment.sig>


More information about the ffmpeg-devel mailing list