Commit e632a430 authored by Michael Niedermayer's avatar Michael Niedermayer

vf_vflip: fix handling of the last line.

Fixes Ticket1271
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a46f8915
......@@ -56,7 +56,7 @@ static AVFilterBufferRef *get_video_buffer(AVFilterLink *link, int perms,
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
if (picref->data[i]) {
picref->data[i] += ((h >> vsub)-1) * picref->linesize[i];
picref->data[i] += (((h + (1<<vsub)-1) >> vsub)-1) * picref->linesize[i];
picref->linesize[i] = -picref->linesize[i];
}
}
......@@ -74,7 +74,7 @@ static void start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
int vsub = i == 1 || i == 2 ? flip->vsub : 0;
if (outpicref->data[i]) {
outpicref->data[i] += ((link->h >> vsub)-1) * outpicref->linesize[i];
outpicref->data[i] += (((link->h + (1<<vsub)-1)>> vsub)-1) * outpicref->linesize[i];
outpicref->linesize[i] = -outpicref->linesize[i];
}
}
......
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