diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-14 00:22:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-09-28 01:35:12 +0200 |
commit | 179ed2d2e08949662de2249c71f01ae388ca851e (patch) | |
tree | d4c636bb174b30a4082134a2e62f81595b3b703d | |
parent | 7274d849cc44f9e4c5573d1b271d99f46ad7d583 (diff) | |
download | ffmpeg-179ed2d2e08949662de2249c71f01ae388ca851e.tar.gz |
avcodec/diracdec: check that GetBitContext has not ended in codeblock()
Fixes: Timeout (part 2 of 2)
Fixes: 9774/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5748957085958144
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/diracdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index cbd7fd1532..af561d1426 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -548,6 +548,8 @@ static inline int codeblock(DiracContext *s, SubBand *b, } } else { for (y = top; y < bottom; y++) { + if (get_bits_left(gb) < 1) + return AVERROR_INVALIDDATA; for (x = left; x < right; x++) { int val = coeff_unpack_golomb(gb, qfactor, qoffset); if (b->pshift) { |