File ffmpeg-CVE-2020-22027.patch of Package ffmpeg
commit e787f8fd7ee99ba0c3e0f086ce2ce59eea7ed86c (HEAD, CVE-2020-22027_20191011_e787f8fd7ee99ba0c3e0f086ce2ce59eea7ed86c)
Author: Paul B Mahol <onemda@gmail.com>
Date: Fri Oct 11 11:18:10 2019 +0200
avfilter/vf_neighbor: check if width is 1
Fixes #8242
--- ffmpeg-3.4.2/libavfilter/vf_neighbor.c
+++ ffmpeg-3.4.2_new/libavfilter/vf_neighbor.c
@@ -189,9 +189,11 @@
src + width - 2, src + width - 1,
src + width - 2 + ph * stride, src + width - 1 + ph * stride, src + width - 1 + ph * stride};
- s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates);
- s->filter(dst + 1, src + 1, width - 2, threshold, coordinates, s->coordinates);
- s->filter(dst + width - 1, src + width - 1, 1, threshold, coordinatesrb, s->coordinates);
+ s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates);
+ if (width > 1) {
+ s->filter(dst + 1, src + 1, width - 2, threshold, coordinates, s->coordinates);
+ s->filter(dst + width - 1, src + width - 1, 1, threshold, coordinatesrb, s->coordinates);
+ }
src += stride;
dst += dstride;