diff alacenc.c @ 10344:2b8a327189cd libavcodec

put_bits can only reliably write up to 31 bit bits, above it relies on undefined shift behaviour. Document this, fix the assert and add a put_bits32 to handle writing 32 bits and use that where necessary.
author reimar
date Thu, 01 Oct 2009 15:40:29 +0000
parents f55ca9a2b948
children b44de7b79bee
line wrap: on
line diff
--- a/alacenc.c	Thu Oct 01 15:30:27 2009 +0000
+++ b/alacenc.c	Thu Oct 01 15:40:29 2009 +0000
@@ -123,7 +123,7 @@
     put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header
     put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field
     put_bits(&s->pbctx, 1,  is_verbatim);                   // Audio block is verbatim
-    put_bits(&s->pbctx, 32, s->avctx->frame_size);          // No. of samples in the frame
+    put_bits32(&s->pbctx, s->avctx->frame_size);            // No. of samples in the frame
 }
 
 static void calc_predictor_params(AlacEncodeContext *s, int ch)