1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avfilter/vf_neighbor: check if width is 1

Fixes #8242

(cherry picked from commit e787f8fd7e)
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Paul B Mahol 2019-10-11 06:18:10 -03:00 committed by James Almer
parent 01f3824f6c
commit f5da6cff35

View File

@ -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;