diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-25 03:48:45 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-05-25 05:14:02 +0200 |
commit | 291ad5cc9cf815eb110b062487980fab2d107936 (patch) | |
tree | 14d59063337abb524b88a945c66884f74f8c75fa | |
parent | 8f5ffed183e099128a732a00976f69fdc641d093 (diff) | |
download | ffmpeg-291ad5cc9cf815eb110b062487980fab2d107936.tar.gz |
avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/bitstream.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index e18171f039..20eae6b1bf 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -70,6 +70,8 @@ void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length) if (length == 0) return; + av_assert0(length <= put_bits_left(pb)); + if (CONFIG_SMALL || words < 16 || put_bits_count(pb) & 7) { for (i = 0; i < words; i++) put_bits(pb, 16, AV_RB16(src + 2 * i)); |