Commit 291ad5cc authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8f5ffed1
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment