mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-10 17:39:56 +00:00
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>
(cherry picked from commit e301736862
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3349be5745
commit
36019fc088
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user