avcodec/hevcdec: Avoid only partly skiping duplicate first slices
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 23 Mar 2019 19:55:08 +0000 (20:55 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 27 Mar 2019 07:42:10 +0000 (08:42 +0100)
commit54655623a82632e7624714d7b2a3e039dc5faa7e
tree48b1e2bd0fb3384bc9b6bfdd8d70bb76b9358e51
parent681957b88d18f51d0f52add4f7bb1c9fc5d8323b
avcodec/hevcdec: Avoid only partly skiping duplicate first slices

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

This also fixes the return code for explode mode

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/hevcdec.c