[FFmpeg-cvslog] avcodec/qpeg: Optimize long runs in qpeg_decode_intra() not spanning a full row
Michael Niedermayer
git at videolan.org
Tue Jan 8 02:58:03 EET 2019
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Jan 7 02:44:50 2019 +0100| [038d291b70bffa550cde552f8325e1b9f71f0646] | committer: Michael Niedermayer
avcodec/qpeg: Optimize long runs in qpeg_decode_intra() not spanning a full row
Fixes: Timeout
Fixes: 11354/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5766275943366656
Before: Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5766275943366656 in 9470 ms
After : Executed clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5766275943366656 in 134 ms
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=038d291b70bffa550cde552f8325e1b9f71f0646
---
libavcodec/qpeg.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index cb452621e7..654fd998d6 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -80,7 +80,10 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst,
p = bytestream2_get_byte(&qctx->buffer);
for(i = 0; i < run; i++) {
- dst[filled++] = p;
+ int step = FFMIN(run - i, width - filled);
+ memset(dst+filled, p, step);
+ filled += step;
+ i += step - 1;
if (filled >= width) {
filled = 0;
dst -= stride;
More information about the ffmpeg-cvslog
mailing list