[FFmpeg-devel] [PATCH]lavf/swfdec: Reduce score when auto-detecting swf files
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
> > 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 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 181 bytes
Desc: not available
More information about the ffmpeg-devel