Commit b8598f6c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/diracdec: fix undefined behavior with shifts

Fixes part of Ticket3466
Found-by: Andrey_Karpov / PVS-Studio
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent ff6fa0b4
...@@ -1355,8 +1355,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5], ...@@ -1355,8 +1355,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
motion_y >>= s->chroma_y_shift; motion_y >>= s->chroma_y_shift;
} }
mx = motion_x & ~(-1 << s->mv_precision); mx = motion_x & ~(-1U << s->mv_precision);
my = motion_y & ~(-1 << s->mv_precision); my = motion_y & ~(-1U << s->mv_precision);
motion_x >>= s->mv_precision; motion_x >>= s->mv_precision;
motion_y >>= s->mv_precision; motion_y >>= s->mv_precision;
/* normalize subpel coordinates to epel */ /* normalize subpel coordinates to epel */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment