diff options
Diffstat (limited to 'libavfilter/vf_interlace.c')
-rw-r--r-- | libavfilter/vf_interlace.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c index 939fabc843..ac435d768a 100644 --- a/libavfilter/vf_interlace.c +++ b/libavfilter/vf_interlace.c @@ -138,8 +138,10 @@ static void copy_picture_field(InterlaceContext *s, int plane, j; for (plane = 0; plane < desc->nb_components; plane++) { - int cols = (plane == 1 || plane == 2) ? -(-inlink->w) >> hsub : inlink->w; - int lines = (plane == 1 || plane == 2) ? -(-inlink->h) >> vsub : inlink->h; + int cols = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->w, hsub) + : inlink->w; + int lines = (plane == 1 || plane == 2) ? AV_CEIL_RSHIFT(inlink->h, vsub) + : inlink->h; uint8_t *dstp = dst_frame->data[plane]; const uint8_t *srcp = src_frame->data[plane]; |