Commit 35517e3c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/gdv: Error out if we had insufficent input for the output frame in decompress_2()

Fixes: Timeout (with the previous commits to gdv.c)
Fixes: 9422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GDV_fuzzer-5143490001371136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 510bd619
......@@ -230,6 +230,10 @@ static int decompress_2(AVCodecContext *avctx)
break;
}
}
if (bytestream2_get_bytes_left_p(pb) > 0)
return AVERROR_INVALIDDATA;
return 0;
}
......@@ -458,6 +462,8 @@ static int gdv_decode_frame(AVCodecContext *avctx, void *data,
default:
av_assert0(0);
}
if (ret < 0)
return ret;
memcpy(frame->data[1], gdv->pal, AVPALETTE_SIZE);
dst = frame->data[0];
......
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