Message ID | 20190223234440.25621-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | b819472995f55e827d6bb70dcdd86d963f65ae31 |
Headers | show |
On Sun, Feb 24, 2019 at 12:44:40AM +0100, Michael Niedermayer wrote: > Fixes: Timeout (27 sec -> 39 milli sec) > Fixes: 13151/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5717536023248896 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/qpeg.c | 2 ++ > 1 file changed, 2 insertions(+) will apply [...]
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 654fd998d6..d4195c5f0b 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -99,6 +99,8 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst, } } } else { + if (bytestream2_get_bytes_left(&qctx->buffer) < copy) + copy = bytestream2_get_bytes_left(&qctx->buffer); for(i = 0; i < copy; i++) { dst[filled++] = bytestream2_get_byte(&qctx->buffer); if (filled >= width) {
Fixes: Timeout (27 sec -> 39 milli sec) Fixes: 13151/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5717536023248896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/qpeg.c | 2 ++ 1 file changed, 2 insertions(+)