From 077cb1bff3645ad5c0c791fd6f6f1ae6468d780c Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Tue, 6 Mar 2001 17:39:03 +0000 Subject: [PATCH] * Fixed an alignment problem on startup. --- src/input/input_ext-dec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/input/input_ext-dec.c b/src/input/input_ext-dec.c index ced9bdd5b9..bb29b1fec9 100644 --- a/src/input/input_ext-dec.c +++ b/src/input/input_ext-dec.c @@ -65,6 +65,15 @@ void InitBitstream( bit_stream_t * p_bit_stream, decoder_fifo_t * p_fifo ) p_bit_stream->fifo.buffer = 0; p_bit_stream->fifo.i_available = 0; vlc_mutex_unlock( &p_fifo->data_lock ); + + if( p_bit_stream->p_byte <= p_bit_stream->p_end - sizeof(WORD_TYPE) ) + { + /* Get aligned on a word boundary. + * NB : we _will_ get aligned, because we have at most + * sizeof(WORD_TYPE) - 1 bytes to store, and at least + * sizeof(WORD_TYPE) - 1 empty bytes in the bit buffer. */ + AlignWord( p_bit_stream ); + } } /***************************************************************************** -- 2.39.2