aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-02-17 00:21:09 +0100
committerMarton Balint <cus@passwd.hu>2019-03-01 22:33:58 +0100
commit694d9d53685333771823285457bdd1ef1480eafc (patch)
tree6160ea602cf3cfc77a860b9a1c68e5c43a188a64
parent902e9334aabbb0bda23b718683c6676c4e6d07af (diff)
downloadffmpeg-694d9d53685333771823285457bdd1ef1480eafc.tar.gz
avcodec/get_bits: add assertion to limit ouptut value of get_bits
Should fix the following Coverity false positives: Coverity CID #1415651. Coverity CID #1420392. Coverity CID #1420473. Coverity CID #1433770. Coverity CID #1435320. Coverity CID #1439573. Coverity CID #1439580. Coverity CID #1439588. Signed-off-by: Marton Balint <cus@passwd.hu>
-rw-r--r--libavcodec/get_bits.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 2e2adc29c2..c2f267186e 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -403,6 +403,7 @@ static inline unsigned int get_bits(GetBitContext *s, int n)
LAST_SKIP_BITS(re, s, n);
CLOSE_READER(re, s);
#endif
+ av_assert2(tmp < UINT64_C(1) << n);
return tmp;
}