aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/pcxenc.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-06-08 22:38:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-08-20 14:29:12 +0200
commit13a9a0c1a492d344a8f36dd4ef3f3957b010963b (patch)
tree1929ac9f18e5800319865b94ac4158707840e954 /libavcodec/pcxenc.c
parent9da5ba1f57a4185d97edac743b42215319307b8c (diff)
downloadffmpeg-13a9a0c1a492d344a8f36dd4ef3f3957b010963b.tar.gz
vp8: change mv_{min,max}.{x,y} type to int
If one of the dimensions is larger than 8176, s->mb_width or s->mb_height is larger than 511, leading to an int16_t overflow of s->mv_max.{x,y}. This then causes av_clip to be called with amin > amax. Changing the type to int avoids the overflow and has no negative effect, because s->mv_max is only used in clamp_mv for clipping. Since mv_max.{x,y} is positive and mv_min.{x,y} negative, av_clip can't increase the absolute value. The input to av_clip is an int16_t, and thus the output fits into int16_t as well. For additional safety, s->mv_{min,max}.{x,y} are clipped to int16_t range before use. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 6fdbaa2b7fb56623ab2163f861952bc1408c39b3) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/pcxenc.c')
0 files changed, 0 insertions, 0 deletions