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>
Thu, 12 Apr 2018 22:35:15 +0000 (00:35 +0200)
commit519d48c861a91f3c458e37478d0e408aa608117c
treedcfa9e972706b00ea1ed856c1bb424823702b6e5
parent878fc42a906d13cd6a78b0820eed75f4fd8e26e5
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>
(cherry picked from commit ab6f571ef71967da7c7c1cfba483d3597c7357d5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/common.h