[FFmpeg-devel] [PATCH]Improce auto-detection for cdata files

Reimar Döffinger Reimar.Doeffinger
Wed Dec 30 21:36:13 CET 2009


On Wed, Dec 30, 2009 at 08:14:49PM +0000, Carl Eugen Hoyos wrote:
> Reimar D?ffinger <Reimar.Doeffinger <at> gmx.de> writes:
> 
> > > -    if (b[0] == 0x04 && (b[1] == 0x00 || b[1] == 0x04 || b[1] == 0x0C))
> > > +    if (b[0] == 0x04 && (b[1] == 0x00 || b[1] == 0x04 || b[1] == 0x0C) &&
> > > +        ((uint32_t *)b)[1] == ((uint32_t *)b)[3] && ((uint32_t *)b)[1])
> > >          return AVPROBE_SCORE_MAX/8;
> > 
> > You should check for a valid sample_rate
> 
> I totally agree.
> What are valid sample rates?

Well, at least != 0. And that check actually should be done in the
read_header as well since we can get a division by 0 otherwise I think.
Otherwise I'd suggest to consider < 4000 as valid (since it is only 16
bit, I wouldn't check for a maximum).



More information about the ffmpeg-devel mailing list