Commit 11a631d4 authored by Davinder Singh's avatar Davinder Singh Committed by Paul B Mahol

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.
parent a0a57072
...@@ -936,8 +936,8 @@ static void set_frame_data(MIContext *mi_ctx, int alpha, AVFrame *avf_out) ...@@ -936,8 +936,8 @@ static void set_frame_data(MIContext *mi_ctx, int alpha, AVFrame *avf_out)
for (i = 0; i < pixel->nb; i++) { for (i = 0; i < pixel->nb; i++) {
Frame *frame = &mi_ctx->frames[pixel->refs[i]]; Frame *frame = &mi_ctx->frames[pixel->refs[i]];
if (chroma) { if (chroma) {
x_mv = (x >> mi_ctx->chroma_h_shift) + (pixel->mvs[i][0] >> mi_ctx->chroma_h_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] >> mi_ctx->chroma_v_shift); y_mv = (y >> mi_ctx->chroma_v_shift) + (pixel->mvs[i][1] / (1 << mi_ctx->chroma_v_shift));
} else { } else {
x_mv = x + pixel->mvs[i][0]; x_mv = x + pixel->mvs[i][0];
y_mv = y + pixel->mvs[i][1]; y_mv = y + pixel->mvs[i][1];
......
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