diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-11 06:18:10 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2021-09-13 16:49:27 -0300 |
commit | f5da6cff3504978bf6e713996988dcef0691d800 (patch) | |
tree | db655d50b9924edf1bc9f8fd599406a265d2288e /libavfilter | |
parent | 01f3824f6c46ef19025059752a4381daa2443097 (diff) | |
download | ffmpeg-f5da6cff3504978bf6e713996988dcef0691d800.tar.gz |
avfilter/vf_neighbor: check if width is 1
Fixes #8242
(cherry picked from commit e787f8fd7ee99ba0c3e0f086ce2ce59eea7ed86c)
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_neighbor.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c index 2db1e5e57c..f84a33ef75 100644 --- a/libavfilter/vf_neighbor.c +++ b/libavfilter/vf_neighbor.c @@ -285,9 +285,11 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) src + (width - 2) * bpc, src + (width - 2) * bpc, src + (width - 2) * bpc + ph * stride, src + (width - 1) * bpc + ph * stride, src + (width - 2) * bpc + ph * stride}; - s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates); - s->filter(dst + 1 * bpc, src + 1 * bpc, width - 2, threshold, coordinates, s->coordinates); - s->filter(dst + (width - 1) * bpc, src + (width - 1) * bpc, 1, threshold, coordinatesrb, s->coordinates); + s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates); + if (width > 1) { + s->filter(dst + 1 * bpc, src + 1 * bpc, width - 2, threshold, coordinates, s->coordinates); + s->filter(dst + (width - 1) * bpc, src + (width - 1) * bpc, 1, threshold, coordinatesrb, s->coordinates); + } src += stride; dst += dstride; |