From b8ecadec0582a1521b5d0d253376966138e6ca78 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 24 Feb 2019 23:39:44 +0100 Subject: avcodec/bethsoftvideo: Check block_type Fixes: Timeout (17 seconds -> 1 second) Fixes: 13184/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BETHSOFTVID_fuzzer-5711446296494080 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/bethsoftvideo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavcodec') diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 274516b..e5a73f5 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -109,6 +109,11 @@ static int bethsoftvid_decode_frame(AVCodecContext *avctx, if(yoffset >= avctx->height) return AVERROR_INVALIDDATA; dst += vid->frame->linesize[0] * yoffset; + case VIDEO_P_FRAME: + case VIDEO_I_FRAME: + break; + default: + return AVERROR_INVALIDDATA; } // main code -- cgit v1.1