avutil/common: Fix integer overflow in av_clip_uint8_c() and av_clip_uint16_c()
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 14 Feb 2018 02:54:13 +0000 (03:54 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 17 Feb 2018 14:56:55 +0000 (15:56 +0100)
commitab6f571ef71967da7c7c1cfba483d3597c7357d5
tree295e1a3a86518acd89b6c29d3103d96f6f9743ab
parent310d56e86f494273e2859cf25dd4ae2433f9a2be
avutil/common: Fix integer overflow in av_clip_uint8_c() and av_clip_uint16_c()

Fixes: 5567/clusterfuzz-testcase-minimized-5769966247739392
Fixes: runtime error: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself

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