avcodec/golomb: Assert that the input is not too large in set_ue_golomb()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 13 Jun 2017 00:56:58 +0000 (02:56 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 13 Jun 2017 02:17:13 +0000 (04:17 +0200)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/golomb.h

index 0833aff..4f55147 100644 (file)
@@ -463,6 +463,7 @@ static inline int get_te(GetBitContext *s, int r, char *file, const char *func,
 static inline void set_ue_golomb(PutBitContext *pb, int i)
 {
     av_assert2(i >= 0);
+    av_assert2(i <= 0xFFFE);
 
     if (i < 256)
         put_bits(pb, ff_ue_golomb_len[i], i + 1);