[FFmpeg-devel] [PATCH] avcodec/ffv1dec_template: Optimize common case in run mode

Carl Eugen Hoyos ceffmpeg at gmail.com
Thu May 23 11:57:14 EEST 2019


Am Do., 23. Mai 2019 um 01:47 Uhr schrieb Michael Niedermayer
<michael at niedermayer.cc>:
>
> Fixes: Timeout (14sec -> 9sec)
> 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 | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c
> index 1b7f6c4bf5..0b1d176ba1 100644
> --- a/libavcodec/ffv1dec_template.c
> +++ b/libavcodec/ffv1dec_template.c
> @@ -86,11 +86,19 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w,
>                          run_mode = 2;
>                      }
>                  }
> +                if (sample[1][x - 1] == sample[0][x - 1]) {
> +                    while (run_count > 1 && w-x > 1) {
> +                        sample[1][x] = sample[0][x];
> +                        x++;
> +                        run_count--;
> +                    }
> +                } else {

Does this change have a measurable effect on your usual sample files?

Carl Eugen


More information about the ffmpeg-devel mailing list