summaryrefslogtreecommitdiff
path: root/libavcodec/fic.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-05-01 20:12:12 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-05-09 22:07:26 +0200
commitc7f95d2bd938b440f1d9310ce4785a28dcb44a09 (patch)
treee9ca56f5aa4bac7d6fb953f7498494bd839148e4 /libavcodec/fic.c
parent8d77debf7dab556b93ea9e936a7762b8e31420ac (diff)
avcodec/fic: Check input size against minimal frame size
Fixes: Timeout (22sec ->54ms) Fixes: 14439/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5660988231122944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/fic.c')
-rw-r--r--libavcodec/fic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 65d102b86b..540078eda1 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -356,7 +356,7 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;
- if (msize <= 0) {
+ if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) {
av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
return AVERROR_INVALIDDATA;
}