You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-07-16 22:42:38 +02:00
avcodec/faxcompr: Check available bits in decode_uncompressed()
Fixes: Timeout
Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112
Fixes: 34966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4587409334468608
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 ff56c139e0
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -144,6 +144,8 @@ static int decode_uncompressed(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
cwi = 10 - av_log2(cwi);
|
cwi = 10 - av_log2(cwi);
|
||||||
|
if (get_bits_left(gb) < cwi + 1)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
skip_bits(gb, cwi + 1);
|
skip_bits(gb, cwi + 1);
|
||||||
if (cwi > 5) {
|
if (cwi > 5) {
|
||||||
newmode = get_bits1(gb);
|
newmode = get_bits1(gb);
|
||||||
|
Reference in New Issue
Block a user