diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-11-15 22:50:35 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-11-15 23:08:43 +0100 |
commit | 1546d487cf12da37d90a080813f8d57ac33036bf (patch) | |
tree | 3e230751b07c7bddbedb9803a36ed4cd9eeb29be | |
parent | 1abcd972c4c0e16f1e83be2fd32a251f51b2946d (diff) | |
download | ffmpeg-1546d487cf12da37d90a080813f8d57ac33036bf.tar.gz |
avcodec/rv40: Test remaining space in loop of get_dimension()
Fixes infinite loop
Fixes: 178/fuzz-3-ffmpeg_VIDEO_AV_CODEC_ID_RV40_fuzzer
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/rv40.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index 465011a079..e5ba215b68 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -109,6 +109,8 @@ static int get_dimension(GetBitContext *gb, const int *dim) val = dim[get_bits1(gb) - val]; if(!val){ do{ + if (get_bits_left(gb) < 8) + return AVERROR_INVALIDDATA; t = get_bits(gb, 8); val += t << 2; }while(t == 0xFF); |