avcodec/shorten: Sanity check nmeans
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 5 Jun 2018 11:03:48 +0000 (13:03 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 16 Jul 2018 17:06:27 +0000 (19:06 +0200)
commitf51163b1666e0d43fc94ac839e80f044ecb8b7c5
tree7ebdd66f18660da76d2ef032cd86c32028d7368c
parent8da3d6916316588ad7c1f6d66e4133b51af9ea94
avcodec/shorten: Sanity check nmeans

Fixes: OOM
Fixes: 8195/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5179785826271232

The reference software appears to use longs for 32bits and it uses int for nmeans
hinting that the intended maximum size was not 32bit.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d91a0b503d7a886587281bc1ee42476aa5e89f85)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/shorten.c