aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-01-23 00:30:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-21 10:42:51 +0100
commitc600c06af96e7cadae6b77e54b220c1c2a240a80 (patch)
tree334dad62fa9d291188074c4c0e6397cb33b1c2a5
parentfcfa104b0e0521dfdb8e5d3d07b81f7552d00b2b (diff)
downloadffmpeg-c600c06af96e7cadae6b77e54b220c1c2a240a80.tar.gz
avcodec/fic: Check that there is input left in fic_decode_block()
Fixes: Timeout Fixes: 12450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5661984622641152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit db1c4acd02af4de5dfbea6012c296470679aa7a6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/fic.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 0b491ef7de..b7b834596b 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -139,6 +139,9 @@ static int fic_decode_block(FICContext *ctx, GetBitContext *gb,
{
int i, num_coeff;
+ if (get_bits_left(gb) < 8)
+ return AVERROR_INVALIDDATA;
+
/* Is it a skip block? */
if (get_bits1(gb)) {
*is_p = 1;