From 43d7c6118d64a8b2772e2d9e0c13413968e776f1 Mon Sep 17 00:00:00 2001 From: Reimar Döffinger Date: Thu, 1 Oct 2009 15:40:29 +0000 Subject: 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. Originally committed as revision 20124 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/alacenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/alacenc.c') diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 5e8defbe8b..691e6df41e 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -123,7 +123,7 @@ static void write_frame_header(AlacEncodeContext *s, int is_verbatim) 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) -- cgit v1.2.3