Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-11 12:18:10 +0300
committerPaul B Mahol <onemda@gmail.com>2019-10-11 12:19:00 +0300
commite787f8fd7ee99ba0c3e0f086ce2ce59eea7ed86c (patch)
treeddd4b5a2353eafd11c6dadeaf31d20ae04f2c01f /libavfilter/vf_neighbor.c
parent1331e001796c656a4a3c770a16121c15ec1db2ac (diff)
avfilter/vf_neighbor: check if width is 1
Fixes #8242
Diffstat (limited to 'libavfilter/vf_neighbor.c')
-rw-r--r--libavfilter/vf_neighbor.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c
index e50d4b4ed0..47c6175a12 100644
--- a/libavfilter/vf_neighbor.c
+++ b/libavfilter/vf_neighbor.c
@@ -296,9 +296,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->max);
- s->filter(dst + 1 * bpc, src + 1 * bpc, width - 2, threshold, coordinates, s->coordinates, s->max);
- s->filter(dst + (width - 1) * bpc, src + (width - 1) * bpc, 1, threshold, coordinatesrb, s->coordinates, s->max);
+ s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates, s->max);
+ if (width > 1) {
+ s->filter(dst + 1 * bpc, src + 1 * bpc, width - 2, threshold, coordinates, s->coordinates, s->max);
+ s->filter(dst + (width - 1) * bpc, src + (width - 1) * bpc, 1, threshold, coordinatesrb, s->coordinates, s->max);
+ }
src += stride;
dst += dstride;