[FFmpeg-cvslog] vf_vflip: fix handling of the last line.
Michael Niedermayer
git at videolan.org
Wed Jun 20 20:25:37 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jun 20 20:14:01 2012 +0200| [e632a430fe03dace7380c11e2bd62ea418e63abc] | committer: Michael Niedermayer
vf_vflip: fix handling of the last line.
Fixes Ticket1271
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e632a430fe03dace7380c11e2bd62ea418e63abc
---
libavfilter/vf_vflip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c
index 6fd5d86..11129b2 100644
--- a/libavfilter/vf_vflip.c
+++ b/libavfilter/vf_vflip.c
@@ -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];
}
}
More information about the ffmpeg-cvslog
mailing list