diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-05-09 17:59:38 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-05-10 17:20:06 +0200 |
commit | 50e66726a237e07f6557eaca1da2e9eb18ee7fda (patch) | |
tree | eb080502558818b6e623309776e254d4be88beed /libavfilter/vf_fade.c | |
parent | d751a2526f9be0e8aa72cb2ebf9b8686c8888e89 (diff) |
lavfi: use ceil right shift for chroma width/height.
This should fix several issues with odd dimensions inputs.
lut, vflip, pad and crop video filters also need to be checked for such
issues. It's possible sws is also affected.
Diffstat (limited to 'libavfilter/vf_fade.c')
-rw-r--r-- | libavfilter/vf_fade.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index 4dbd4c7d37..4f7039e691 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -233,8 +233,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) /* chroma planes */ for (plane = 1; plane < 3; plane++) { for (i = 0; i < frame->height; i++) { + const int width = FF_CEIL_RSHIFT(inlink->w, fade->hsub); p = frame->data[plane] + (i >> fade->vsub) * frame->linesize[plane]; - for (j = 0; j < inlink->w >> fade->hsub; j++) { + for (j = 0; j < width; j++) { /* 8421367 = ((128 << 1) + 1) << 15. It is an integer * representation of 128.5. The .5 is for rounding * purposes. */ |