On 03/03/16 00:52, Vittorio Giovara wrote:
> From: Michael Niedermayer
>
> Found-by: Clang -fsanitize=shift
> Reported-by: Thierry Foucu
> Signed-off-by: Vittorio Giovara
> ---
> libavcodec/mpegvideo_motion.c | 8 +---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c
> index 05375a1..04f4020 100644
> --- a/libavcodec/mpegvideo_motion.c
> +++ b/libavcodec/mpegvideo_motion.c
> @@ -318,23 +318,25 @@ void mpeg_motion_internal(MpegEncContext *s,
> src_y);
> return;
> }
> +src_y = (unsigned)src_y << field_based;
> 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,
> 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)) {
> uint8_t *uvbuf = s->sc.edge_emu_buffer + 18 * s->linesize;
> +uvsrc_y = (unsigned)uvsrc_y << field_based;
> 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,
> 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,
> s->h_edge_pos >> 1, s->v_edge_pos >> 1);
> ptr_cb = uvbuf;
> ptr_cr = uvbuf + 16;
>
which is the range of src_y and uvsrc_y ? If it cannot be negative why
not using unsigned and be done with it?
lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel