Commit 179ed2d2 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 7274d849
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment