diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-04-16 02:06:37 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-05 00:09:17 +0200 |
commit | 10e023c4fa73269ab9f65339c919cb113700c08c (patch) | |
tree | af7d81fb2da4fa72a886dc2cab00c93e4c526ba8 | |
parent | 27a3a59428e711181a562c101657ed391faba790 (diff) | |
download | ffmpeg-10e023c4fa73269ab9f65339c919cb113700c08c.tar.gz |
avcodec/diracdec: fix undefined behavior with shifts
Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b8598f6ce61ccda3f2ff0c730b009fb650e42986)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/diracdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index 0ab74749d5..8ab0eb0872 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1355,8 +1355,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5], motion_y >>= s->chroma_y_shift; } - mx = motion_x & ~(-1 << s->mv_precision); - my = motion_y & ~(-1 << s->mv_precision); + mx = motion_x & ~(-1U << s->mv_precision); + my = motion_y & ~(-1U << s->mv_precision); motion_x >>= s->mv_precision; motion_y >>= s->mv_precision; /* normalize subpel coordinates to epel */ |