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

Paul B Mahol onemda at gmail.com
Sat Nov 24 11:02:37 CET 2012


On 11/24/12, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> 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...

than patch ok
>
>> It is just remark that code looks somehow ugly....
>
> I understand.
> Does an assert make it any better?

Your choice, it does not matter any more for me.


More information about the ffmpeg-devel mailing list