Fixes: Timeout
Fixes: 11663/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5636791864918016
Before:Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-
5636791864918016 in 26006 ms
After: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-
5636791864918016 in 106 ms
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
c->counter = -16;
c->range = 0xffff;
c->error = 0;
+ c->overread= 0;
for (i = 0; i < DIRAC_CTX_COUNT; i++)
c->contexts[i] = 0x8000;
uint16_t contexts[DIRAC_CTX_COUNT];
int error;
+ int overread;
} DiracArith;
extern const uint8_t ff_dirac_next_ctx[DIRAC_CTX_COUNT];
new |= 0xff00;
c->bytestream = c->bytestream_end;
+ c->overread ++;
+ if (c->overread > 4)
+ c->error = AVERROR_INVALIDDATA;
}
c->low += new << counter;