aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-25 05:31:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-25 05:31:26 +0200
commitbd46e78aa4e7fe003f647491c475f6b1a56d1743 (patch)
tree2ec65b3ed1d77b8c90f7b860056250edb183e5d3
parent291ad5cc9cf815eb110b062487980fab2d107936 (diff)
downloadffmpeg-bd46e78aa4e7fe003f647491c475f6b1a56d1743.tar.gz
avcodec/put_bits: Assert that size in set_put_bits_buffer_size() does not cause integer overflows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/put_bits.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 1a6f0afaa8..5b1bc8b8b7 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -252,6 +252,7 @@ static inline void skip_put_bits(PutBitContext *s, int n)
*/
static inline void set_put_bits_buffer_size(PutBitContext *s, int size)
{
+ av_assert0(size <= INT_MAX/8 - 32);
s->buf_end = s->buf + size;
s->size_in_bits = 8*size;
}