[FFmpeg-devel] [PATCH] avcodec/hevcdec: Avoid only partly skiping duplicate first slices

James Almer jamrial at gmail.com
Sat Mar 23 22:33:25 EET 2019


On 3/23/2019 5:25 PM, Michael Niedermayer wrote:
> Fixes: NULL pointer dereference and out of array access
> Fixes: 13871/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5746167087890432
> Fixes: 13845/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5650370728034304
> 
> 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/hevcdec.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 86adab0ae1..4d149f4d9f 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -488,6 +488,9 @@ static int hls_slice_header(HEVCContext *s)
>  
>      // Coded parameters
>      sh->first_slice_in_pic_flag = get_bits1(gb);
> +    if (s->ref && sh->first_slice_in_pic_flag)
> +        return 0; // This slice will be skiped later, do not corrupt state

I assume this is a regression after 70c8c8a818? If so, please also
backport this patch to branches 2.8 to 4.1.

> +
>      if ((IS_IDR(s) || IS_BLA(s)) && sh->first_slice_in_pic_flag) {
>          s->seq_decode = (s->seq_decode + 1) & 0xff;
>          s->max_ra     = INT_MAX;
> 



More information about the ffmpeg-devel mailing list