avcodec/ilbcdec: Fix undefined integer overflow lsf2poly()
authorMichael Niedermayer <michael@niedermayer.cc>
Mon, 14 Jan 2019 23:09:30 +0000 (00:09 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 28 Jan 2019 00:09:38 +0000 (01:09 +0100)
commit4523cc5e75c8ecfba8975d16e96c29f9bf70973f
tree9d7facdc00238f0419d6bdf807f07d2b272ca6b0
parentc95d0fb23917c35886f3b62daa05af20d2700a1e
avcodec/ilbcdec: Fix undefined integer overflow lsf2poly()

The addition is moved up into the context where the variable is unsigned avoiding
the undefined behavior

Fixes: runtime error: signed integer overflow: 2147481972 + 4096 cannot be represented in type 'int'
Fixes: 12444/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5755706244857856

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