提交 ce3b0b90 编写于 作者: M Michael Niedermayer

avcodec/loco: Limit lossy parameter so it is sane and does not overflow

Fixes: 15248/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5087440458481664
Fixes: signed integer overflow: 3 + 2147483647 cannot be represented in type 'int'

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: NMichael Niedermayer <michael@niedermayer.cc>
上级 696312c4
......@@ -295,6 +295,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
avpriv_request_sample(avctx, "LOCO codec version %i", version);
}
if (l->lossy > 65536U) {
av_log(avctx, AV_LOG_ERROR, "lossy %i is too large\n", l->lossy);
return AVERROR_INVALIDDATA;
}
l->mode = AV_RL32(avctx->extradata + 4);
switch (l->mode) {
case LOCO_CYUY2:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册