diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-11-12 04:48:24 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-15 03:03:58 +0100 |
commit | f043965cd5145d8540d55c013b0d809b6a874c53 (patch) | |
tree | 3f777aafee81cc04357b569af678fd46a15cc79b | |
parent | 933eca91e6054d46d2a515716eac2d6ae658601b (diff) | |
download | ffmpeg-f043965cd5145d8540d55c013b0d809b6a874c53.tar.gz |
avfilter/vf_tinterlace: fix linesize vs. width
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/vf_tinterlace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index 4ce69daffe..a3cb52d361 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -187,6 +187,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], for (plane = 0; plane < desc->nb_components; plane++) { int lines = plane == 1 || plane == 2 ? FF_CEIL_RSHIFT(src_h, vsub) : src_h; + int cols = plane == 1 || plane == 2 ? FF_CEIL_RSHIFT( w, desc->log2_chroma_w) : w; int linesize = av_image_get_linesize(format, w, plane); uint8_t *dstp = dst[plane]; const uint8_t *srcp = src[plane]; @@ -210,7 +211,7 @@ void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], const uint8_t *srcp_below = srcp + src_linesize[plane]; if (h == lines) srcp_above = srcp; // there is no line above if (h == 1) srcp_below = srcp; // there is no line below - for (i = 0; i < linesize; i++) { + for (i = 0; i < cols; i++) { // this calculation is an integer representation of // '0.5 * current + 0.25 * above + 0.25 * below' // '1 +' is for rounding. */ |