aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/golomb.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-06 18:25:02 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-06 18:25:02 +0200
commit0884b1c5ffe07584984dadad29346c95c78fac19 (patch)
tree418e4da9af70089c3191927823b4092e22bfa1f1 /libavcodec/golomb.h
parent9bf4523e40148fdd27064ab570952bd8c4d1016e (diff)
downloadffmpeg-0884b1c5ffe07584984dadad29346c95c78fac19.tar.gz
avcodec/golomb: Assert that k is valid in get_ur_golomb_jpegls()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r--libavcodec/golomb.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 47b369f88c..6911759c6b 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -314,6 +314,8 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
log = av_log2(buf);
+ av_assert2(k <= 31);
+
if (log - k >= 32 - MIN_CACHE_BITS + (MIN_CACHE_BITS == 32) &&
32 - log < limit) {
buf >>= log - k;