aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mvha.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-12-06 00:07:17 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-06 11:25:29 +0100
commite7011a0ca6548e12b458259c51e305e8a4d5ae2e (patch)
treee1aac261aa44704c49d5fb0d3f0e8b3061287f87 /libavcodec/mvha.c
parent5ee4c12ec277028ece4b18c703dc9cd3e3b885e0 (diff)
downloadffmpeg-e7011a0ca6548e12b458259c51e305e8a4d5ae2e.tar.gz
avcodec/mvha: Check remaining space when reading VLC table probabilities
Fixes: Infinite loop Fixes: 19183/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-5666216765292544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mvha.c')
-rw-r--r--libavcodec/mvha.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c
index 4b03a79283..c270063b1c 100644
--- a/libavcodec/mvha.c
+++ b/libavcodec/mvha.c
@@ -203,6 +203,9 @@ static int decode_frame(AVCodecContext *avctx,
for (int i = 0; i < s->nb_symbols; symbol++) {
int prob;
+ if (get_bits_left(gb) < 4)
+ return AVERROR_INVALIDDATA;
+
if (get_bits1(gb)) {
prob = get_bits(gb, 12);
} else {