Commit 02423513 authored by Luca Barbato's avatar Luca Barbato Committed by Vittorio Giovara

mpegvideo: Fix undefined negative shifts in mpeg_motion_internal

Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent 7d4a1ff3
...@@ -321,7 +321,7 @@ void mpeg_motion_internal(MpegEncContext *s, ...@@ -321,7 +321,7 @@ void mpeg_motion_internal(MpegEncContext *s,
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y,
s->linesize, s->linesize, s->linesize, s->linesize,
17, 17 + field_based, 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); s->h_edge_pos, s->v_edge_pos);
ptr_y = s->sc.edge_emu_buffer; ptr_y = s->sc.edge_emu_buffer;
if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
...@@ -329,12 +329,12 @@ void mpeg_motion_internal(MpegEncContext *s, ...@@ -329,12 +329,12 @@ void mpeg_motion_internal(MpegEncContext *s,
s->vdsp.emulated_edge_mc(uvbuf, ptr_cb, s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
s->uvlinesize, s->uvlinesize, s->uvlinesize, s->uvlinesize,
9, 9 + field_based, 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->h_edge_pos >> 1, s->v_edge_pos >> 1);
s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr, s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
s->uvlinesize, s->uvlinesize, s->uvlinesize, s->uvlinesize,
9, 9 + field_based, 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->h_edge_pos >> 1, s->v_edge_pos >> 1);
ptr_cb = uvbuf; ptr_cb = uvbuf;
ptr_cr = uvbuf + 16; ptr_cr = uvbuf + 16;
...@@ -542,7 +542,7 @@ static inline void qpel_motion(MpegEncContext *s, ...@@ -542,7 +542,7 @@ static inline void qpel_motion(MpegEncContext *s,
s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y, s->vdsp.emulated_edge_mc(s->sc.edge_emu_buffer, ptr_y,
s->linesize, s->linesize, s->linesize, s->linesize,
17, 17 + field_based, 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); s->h_edge_pos, s->v_edge_pos);
ptr_y = s->sc.edge_emu_buffer; ptr_y = s->sc.edge_emu_buffer;
if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) { if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
...@@ -550,12 +550,12 @@ static inline void qpel_motion(MpegEncContext *s, ...@@ -550,12 +550,12 @@ static inline void qpel_motion(MpegEncContext *s,
s->vdsp.emulated_edge_mc(uvbuf, ptr_cb, s->vdsp.emulated_edge_mc(uvbuf, ptr_cb,
s->uvlinesize, s->uvlinesize, s->uvlinesize, s->uvlinesize,
9, 9 + field_based, 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->h_edge_pos >> 1, s->v_edge_pos >> 1);
s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr, s->vdsp.emulated_edge_mc(uvbuf + 16, ptr_cr,
s->uvlinesize, s->uvlinesize, s->uvlinesize, s->uvlinesize,
9, 9 + field_based, 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->h_edge_pos >> 1, s->v_edge_pos >> 1);
ptr_cb = uvbuf; ptr_cb = uvbuf;
ptr_cr = uvbuf + 16; ptr_cr = uvbuf + 16;
......
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