avcodec/cngdec: Fix integer clipping
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 2 Nov 2017 17:34:09 +0000 (18:34 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 9 Nov 2017 18:59:15 +0000 (19:59 +0100)
commitc02dece8938ece9b7ff794528b982f3e7c152a23
treea51b3cbff0ecab1f20dc42954d42241b6bd5ad4f
parent50c4028ee53d01ea01b8699fbcb05410ac9aa77a
avcodec/cngdec: Fix integer clipping

Fixes: runtime error: value -36211.7 is outside the range of representable values of type 'short'
Fixes: 2992/clusterfuzz-testcase-6649611793989632

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 51090133b31bc719ea868db15d3ee38e9dbe90f1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/cngdec.c