summaryrefslogtreecommitdiff
path: root/libavcodec/get_bits.h
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-08 08:30:56 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-09-08 08:30:56 +0000
commit17f0c3be8ecbf3555d763007bd51583ad3f63cc0 (patch)
treea4bd604fe0ed006e82b9326c7ab96dd19bd4b22a /libavcodec/get_bits.h
parente4bc8af1e687efb2a2c41a469ac7b31f1c3d48cd (diff)
Try to clarify that anyone using get_bits must check for buffer overrun
themselves, get_bits does not do anything in that regard. Originally committed as revision 19794 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r--libavcodec/get_bits.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 877f909a74..19333c2f78 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -489,6 +489,9 @@ static inline int check_marker(GetBitContext *s, const char *msg)
* @param buffer bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE bytes larger then the actual read bits
* because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
* @param bit_size the size of the buffer in bits
+ *
+ * While GetBitContext stores the buffer size, for performance reasons you are
+ * responsible for checking for the buffer end yourself (take advantage of the padding)!
*/
static inline void init_get_bits(GetBitContext *s,
const uint8_t *buffer, int bit_size)