aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-04-15 20:08:22 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:20 +0200
commit0ccbac1ee80465dbe0193fec454b75acdfa748cb (patch)
tree2463386c7d8b7e875bf98538949dc013d748705f
parentfacc1ef12b48defb7ab2f130f4f1ec7736309cdd (diff)
downloadffmpeg-0ccbac1ee80465dbe0193fec454b75acdfa748cb.tar.gz
avcodec/faxcompr: Check remaining bits on error in decode_group3_1d_line()
Fixes: Timeout Fixes: 32886/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4779761466474496 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 7b3881f0da6da00cb6b5b123328e2fbfca936c47) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/faxcompr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index 2a1d2bc3f6..400458b994 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -224,7 +224,7 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
run = 0;
mode = !mode;
} else if ((int)t == -1) {
- if (show_bits(gb, 12) == 15) {
+ if (get_bits_left(gb) > 12 && show_bits(gb, 12) == 15) {
int ret;
skip_bits(gb, 12);
ret = decode_uncompressed(avctx, gb, &pix_left, &runs, runend, &mode);