diff options
author | Davinder Singh <ds.mudhar@gmail.com> | 2016-08-29 17:04:54 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2016-08-29 17:32:47 +0200 |
commit | 11a631d4a76859e09cd413856e32df6363d25eea (patch) | |
tree | 6026718b835e2656ad6fa0321c12072427697afe /libavfilter/vf_minterpolate.c | |
parent | a0a57072c93be397afe346d03b907397d6b88396 (diff) | |
download | ffmpeg-11a631d4a76859e09cd413856e32df6363d25eea.tar.gz |
avfilter/vf_minterpolate: do not right shift negative numbers
It was source of crashes. Use division instead.
Original patch by author. Log message by comitter.
Diffstat (limited to 'libavfilter/vf_minterpolate.c')
-rw-r--r-- | libavfilter/vf_minterpolate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c index 5b41cd8f46..76a546f7d2 100644 --- a/libavfilter/vf_minterpolate.c +++ b/libavfilter/vf_minterpolate.c @@ -936,8 +936,8 @@ static void set_frame_data(MIContext *mi_ctx, int alpha, AVFrame *avf_out) for (i = 0; i < pixel->nb; i++) { Frame *frame = &mi_ctx->frames[pixel->refs[i]]; if (chroma) { - x_mv = (x >> mi_ctx->chroma_h_shift) + (pixel->mvs[i][0] >> mi_ctx->chroma_h_shift); - y_mv = (y >> mi_ctx->chroma_v_shift) + (pixel->mvs[i][1] >> mi_ctx->chroma_v_shift); + x_mv = (x >> mi_ctx->chroma_h_shift) + (pixel->mvs[i][0] / (1 << mi_ctx->chroma_h_shift)); + y_mv = (y >> mi_ctx->chroma_v_shift) + (pixel->mvs[i][1] / (1 << mi_ctx->chroma_v_shift)); } else { x_mv = x + pixel->mvs[i][0]; y_mv = y + pixel->mvs[i][1]; |