avutil/common: Fix undefined behavior in av_clip_uintp2_c()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 14 Jun 2018 13:41:33 +0000 (15:41 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 16 Jul 2018 17:06:27 +0000 (19:06 +0200)
commit96cf8a9cf993db44007dd438edbbbdf69279943e
tree5296ab958b6d84c6eda81f2763133607615e1792
parentb5d51d23a068f7511662acd363b39d2f922dff0e
avutil/common: Fix undefined behavior in av_clip_uintp2_c()

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 8521/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5639024952737792

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 aa41d322be71106ce147445f2b42bb763f1eff86)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavutil/common.h