Mercurial > libavcodec.hg
comparison get_bits.h @ 10148:732dfbf67524 libavcodec
Try to clarify that anyone using get_bits must check for buffer overrun
themselves, get_bits does not do anything in that regard.
author | reimar |
---|---|
date | Tue, 08 Sep 2009 08:30:56 +0000 |
parents | 0dce4fe6e6f3 |
children | 24c03529ccbe |
comparison
equal
deleted
inserted
replaced
10147:98fdef0c35a1 | 10148:732dfbf67524 |
---|---|
487 /** | 487 /** |
488 * init GetBitContext. | 488 * init GetBitContext. |
489 * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits | 489 * @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits |
490 * because some optimized bitstream readers read 32 or 64 bit at once and could read over the end | 490 * because some optimized bitstream readers read 32 or 64 bit at once and could read over the end |
491 * @param bit_size the size of the buffer in bits | 491 * @param bit_size the size of the buffer in bits |
492 * | |
493 * While GetBitContext stores the buffer size, for performance reasons you are | |
494 * responsible for checking for the buffer end yourself (take advantage of the padding)! | |
492 */ | 495 */ |
493 static inline void init_get_bits(GetBitContext *s, | 496 static inline void init_get_bits(GetBitContext *s, |
494 const uint8_t *buffer, int bit_size) | 497 const uint8_t *buffer, int bit_size) |
495 { | 498 { |
496 int buffer_size= (bit_size+7)>>3; | 499 int buffer_size= (bit_size+7)>>3; |