[FFmpeg-devel] remove int readers

Måns Rullgård mans
Thu Jun 14 18:06:44 CEST 2007


Ronald S. Bultje wrote:
> Hi,
>
> On 6/14/07, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>
> wrote:
>>
>> > -        version = get_bits(&gb, 8) << 16;
>> > -        version |= get_bits(&gb, 8) << 8;
>> > -        version |= get_bits(&gb, 8);
>> > -
>> > +        version = get_bits(&gb, 24);
>>
>> I think you must use get_bits_long to read 24 bits. And I assume you
>> checked that this actually gives the same result? (depends on bitstream
>> reader used).
>
>
> I think it's used with values up to 32 in various places, even in
> oggparsetheora.c itself. Also, since the return value is an unsigned int
> (32bits), it should be ok.

For more than 17 bits get_bits_long must be used.  Anything else is a bug.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list