diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-10-13 17:23:10 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-05-04 18:42:56 +0200 |
commit | 7cab59a34f3acafd165a5fc407d0af7a67bc70ce (patch) | |
tree | f645faabe922b069cf368d1538bf643de195bc1d | |
parent | ab0b268bb78ccd5ba4411594ae74a368ad2186e1 (diff) | |
download | ffmpeg-7cab59a34f3acafd165a5fc407d0af7a67bc70ce.tar.gz |
avfilter/vf_edgedetect: check if height is big enough
Fixes #8260
(cherry picked from commit ccf4ab8c9aca0aee66bcc2914031a9c97ac0eeb8)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavfilter/vf_edgedetect.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c index ac88e02a11..ca4f715dbf 100644 --- a/libavfilter/vf_edgedetect.c +++ b/libavfilter/vf_edgedetect.c @@ -122,7 +122,8 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int h, int i, j; memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; - memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; + if (h > 1) + memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; for (j = 2; j < h - 2; j++) { dst[0] = src[0]; dst[1] = src[1]; @@ -152,8 +153,10 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int h, dst += dst_linesize; src += src_linesize; } - memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; - memcpy(dst, src, w); + if (h > 2) + memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; + if (h > 3) + memcpy(dst, src, w); } enum { |