[FFmpeg-devel] [RFC]Support G.726 in Sun AU

Carl Eugen Hoyos cehoyos at ag.or.at
Sat Nov 24 10:57:05 CET 2012


Paul B Mahol <onemda <at> gmail.com> writes:

> >> > @@ -145,7 +162,9 @@ static int au_read_header
> >> >      codec = ff_codec_get_id(codec_au_tags, id);
> >> >
> >> > -    if (!(bps = av_get_bits_per_sample(codec))) {
> >> > +    if (codec == AV_CODEC_ID_ADPCM_G726) {
> >> > +        au->bps = (uint8_t []){4, 0, 3, 5}[id - 23];
> >>
> >> bps could become 0 in future causing division by 0 in later code.
> >
> > Could you explain how it can become 0, I don't understand?
> 
> If someone adds G726 codec with id 24 but does not change this line.

I just added G722 with id 24 that you reviewed...

> It is just remark that code looks somehow ugly....

I understand.
Does an assert make it any better?

Carl Eugen



More information about the ffmpeg-devel mailing list