mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-19 05:49:09 +02:00
avcodec/indeo2: Check remaining input more often
Fixes: Timeout (95sec -> 30ms) Fixes: 14765/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO2_fuzzer-5692455527120896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 52939a2c5772ec00101d293695d0a96dcccf99d9) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
94242dd739
commit
6201a60631
@ -78,10 +78,11 @@ static int ir2_decode_plane(Ir2Context *ctx, int width, int height, uint8_t *dst
|
||||
|
||||
for (j = 1; j < height; j++) {
|
||||
out = 0;
|
||||
if (get_bits_left(&ctx->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
while (out < width) {
|
||||
int c = ir2_get_code(&ctx->gb);
|
||||
int c;
|
||||
if (get_bits_left(&ctx->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
c = ir2_get_code(&ctx->gb);
|
||||
if (c >= 0x80) { /* we have a skip */
|
||||
c -= 0x7F;
|
||||
if (out + c*2 > width)
|
||||
@ -122,9 +123,9 @@ static int ir2_decode_plane_inter(Ir2Context *ctx, int width, int height, uint8_
|
||||
|
||||
for (j = 0; j < height; j++) {
|
||||
out = 0;
|
||||
if (get_bits_left(&ctx->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
while (out < width) {
|
||||
if (get_bits_left(&ctx->gb) <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
c = ir2_get_code(&ctx->gb);
|
||||
if (c >= 0x80) { /* we have a skip */
|
||||
c -= 0x7F;
|
||||
|
Loading…
x
Reference in New Issue
Block a user