Message ID | 20190131130902.26536-2-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 2115da163f..c85f310140 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -86,11 +86,7 @@ static void gif_read_palette(GifState *s, uint32_t *pal, int nb) static void gif_fill(AVFrame *picture, uint32_t color) { - uint32_t *p = (uint32_t *)picture->data[0]; - uint32_t *p_end = p + (picture->linesize[0] / sizeof(uint32_t)) * picture->height; - - for (; p < p_end; p++) - *p = color; + av_memset_bytes(picture->data[0], picture->linesize[0] * picture->height, &color, 4); } static void gif_fill_rect(AVFrame *picture, uint32_t color, int l, int t, int w, int h)
Improves speed for 780/clusterfuzz-testcase-6393552642768896 from 95 sec to 60 sec Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/gifdec.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)