diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-06 22:25:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-06 23:04:10 +0200 |
commit | 094a82c7de30b6a086c785aa14cc7e2e2eb3418e (patch) | |
tree | af403e2a9cbb217b8810a780e8d8f6cbd6cb6248 /libavcodec/get_bits.h | |
parent | ac6659aff77b08a894967a2880eef13218baacb9 (diff) | |
download | ffmpeg-094a82c7de30b6a086c785aa14cc7e2e2eb3418e.tar.gz |
get_bits: get_bits_long() support n=0 as the docs allow it
also the 0 case is indeed used in some code pathes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r-- | libavcodec/get_bits.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h index 05ac8f7ef9..a1a48ab87d 100644 --- a/libavcodec/get_bits.h +++ b/libavcodec/get_bits.h @@ -302,7 +302,9 @@ static inline void skip_bits1(GetBitContext *s) */ static inline unsigned int get_bits_long(GetBitContext *s, int n) { - if (n <= MIN_CACHE_BITS) + if (!n) { + return 0; + } else if (n <= MIN_CACHE_BITS) return get_bits(s, n); else { #ifdef BITSTREAM_READER_LE |