aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo_motion.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2016-03-04 16:57:29 +0100
committerVittorio Giovara <vittorio.giovara@gmail.com>2016-03-05 08:26:36 -0500
commit0242351390643d176b10600c2eb854414f9559e6 (patch)
tree7d18b1134edd7c360da38bdcff7887ddc8d4877f /libavcodec/mpegvideo_motion.c
parent7d4a1ff344cbf969ac648642a0fd8484fd5b8637 (diff)
downloadffmpeg-0242351390643d176b10600c2eb854414f9559e6.tar.gz
mpegvideo: Fix undefined negative shifts in mpeg_motion_internal
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/mpegvideo_motion.c')
-rw-r--r--libavcodec/mpegvideo_motion.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
index 05375a1afa..aaa6e6116e 100644
--- a/libavcodec/mpegvideo_motion.c
+++ b/libavcodec/mpegvideo_motion.c
@@ -321,7 +321,7 @@ void mpeg_motion_internal(MpegEncContext *s,
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y,
s->linesize, s->linesize,
17, 17 + field_based,
- src_x, src_y << field_based,
+ src_x, src_y * (1 << field_based),
s->h_edge_pos, s->v_edge_pos);
ptr_y = s->sc.edge_emu_buffer;
if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
@@ -329,12 +329,12 @@ void mpeg_motion_internal(MpegEncContext *s,
s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
s->uvlinesize, s->uvlinesize,
9, 9 + field_based,
- uvsrc_x, uvsrc_y << field_based,
+ uvsrc_x, uvsrc_y * (1 << field_based),
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
s->uvlinesize, s->uvlinesize,
9, 9 + field_based,
- uvsrc_x, uvsrc_y << field_based,
+ uvsrc_x, uvsrc_y * (1 << field_based),
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
ptr_cb = uvbuf;
ptr_cr = uvbuf + 16;
@@ -542,7 +542,7 @@ static inline void qpel_motion(MpegEncContext *s,
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y,
s->linesize, s->linesize,
17, 17 + field_based,
- src_x, src_y << field_based,
+ src_x, src_y * (1 << field_based),
s->h_edge_pos, s->v_edge_pos);
ptr_y = s->sc.edge_emu_buffer;
if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
@@ -550,12 +550,12 @@ static inline void qpel_motion(MpegEncContext *s,
s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
s->uvlinesize, s->uvlinesize,
9, 9 + field_based,
- uvsrc_x, uvsrc_y << field_based,
+ uvsrc_x, uvsrc_y * (1 << field_based),
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
s->uvlinesize, s->uvlinesize,
9, 9 + field_based,
- uvsrc_x, uvsrc_y << field_based,
+ uvsrc_x, uvsrc_y * (1 << field_based),
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
ptr_cb = uvbuf;
ptr_cr = uvbuf + 16;