[FFmpeg-devel] [PATCH v2] add put_bits_long to avoid undefined behaviour in put_bits

matthieu CASTET castet.matthieu
Tue Sep 8 21:58:35 CEST 2009


Diego Biurrun <diego <at> biurrun.de> writes:

> 
> On Tue, Aug 25, 2009 at 09:45:08PM +0200, matthieu castet wrote:
> >  
> > +static inline void put_bits_long(PutBitContext *s, int n, unsigned int
> > +{
> > +    if(n<=31) 
> 
> if (n <= 31)
> 
I copied it from get_bits_long style, but ok I will change it.


> >      put_bits(&s->pbctx, 1,  is_verbatim);                  
> > -    put_bits(&s->pbctx, 32, s->avctx->frame_size);          
> > +    put_bits_long(&s->pbctx, 32, s->avctx->frame_size);          
> 
> This should remain aligned.
> 
What do you suggest ?


Thanks

Matthieu







More information about the ffmpeg-devel mailing list