avcodec/cook: Check samples_per_channel earlier
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 23 Oct 2019 17:41:27 +0000 (19:41 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 9 Nov 2019 16:55:07 +0000 (17:55 +0100)
commit57750bb629a145326e20b8760f21f1041464a937
treefd72d68d83904de519fd3df1a02e8ac4909b24a4
parentde5102fd92de8d353fdf060375ed3ce859c83977
avcodec/cook: Check samples_per_channel earlier

Fixes: division by zero
Fixes: 18362/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5653727679086592

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