aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-25 03:48:45 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-01 23:25:19 +0200
commit796cc5a5eb58c0dc307813ebfda453636685dad2 (patch)
tree16cbd40fb49f9424b14f2ed53dd040407e6ae307 /libavcodec
parent5b5002279d5dc85c90c302c540a5cdd53ac31f64 (diff)
downloadffmpeg-796cc5a5eb58c0dc307813ebfda453636685dad2.tar.gz
avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 291ad5cc9cf815eb110b062487980fab2d107936) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/bitstream.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index d041643eff..2e102df71b 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -69,6 +69,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));