[FFmpeg-devel] [PATCH 1/2] avcodec/ffv1dec_template: Optimize golomb run mode

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Mar 8 19:33:30 EET 2019


2019-03-08 17:38 GMT+01:00, Michael Niedermayer <michael at niedermayer.cc>:
> Fixes: Timeout (34sec -> 12sec)

Am I correct that this is the speedup for an invalid input file?
Is there a measurable effect on valid files?

> Fixes:
> 13398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-5664106709778432
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavcodec/ffv1dec_template.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c
> index 25032feda0..1b7f6c4bf5 100644
> --- a/libavcodec/ffv1dec_template.c
> +++ b/libavcodec/ffv1dec_template.c
> @@ -86,6 +86,11 @@ static av_always_inline int
> RENAME(decode_line)(FFV1Context *s, int w,
>                          run_mode = 2;
>                      }
>                  }
> +                while (run_count > 1 && w-x > 1) {
> +                    sample[1][x] = RENAME(predict)(sample[1] + x, sample[0]
> + x);
> +                    x++;
> +                    run_count--;
> +                }

Carl Eugen


More information about the ffmpeg-devel mailing list