summaryrefslogtreecommitdiffstats
path: root/libavcodec/flicvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-12 21:17:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-08-15 01:26:21 +0200
commite301736862f18a449c317a47d0d60d3484e41667 (patch)
treed385590a8cc2b2db5a05a61f7f285d9d3be15705 /libavcodec/flicvideo.c
parentc812db814ebd603106220854e343558ec1115e57 (diff)
downloadffmpeg-streaming-e301736862f18a449c317a47d0d60d3484e41667.zip
ffmpeg-streaming-e301736862f18a449c317a47d0d60d3484e41667.tar.gz
avcodec/flicvideo: Optimize and Simplify FLI_COPY in flic_decode_frame_24BPP() by using bytestream2_get_buffer()
Fixes: Timeout (31sec -> 22sec) Fixes: 16217/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-5658084189405184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/flicvideo.c')
-rw-r--r--libavcodec/flicvideo.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index 99868f3..bf8ffeb 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -1024,14 +1024,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx,
for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height;
y_ptr += s->frame->linesize[0]) {
- pixel_countdown = s->avctx->width;
- pixel_ptr = 0;
- while (pixel_countdown > 0) {
- pixel = bytestream2_get_le24(&g2);
- AV_WL24(&pixels[y_ptr + pixel_ptr], pixel);
- pixel_ptr += 3;
- pixel_countdown--;
- }
+ bytestream2_get_buffer(&g2, pixels + y_ptr, 3*s->avctx->width);
if (s->avctx->width & 1)
bytestream2_skip(&g2, 3);
}
OpenPOWER on IntegriCloud