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-13 18:23:10 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 21:00:05 +0300
commitff1c55c91355257f66049fc9caba7953c1c2288f (patch)
tree8bbd0ea0b33c644420435e58bdf4b8f4a0c0827f /libavfilter
parent72bc9bd8ef493bd43db2f1dd92ddb1cb0b1f00b0 (diff)
avfilter/vf_edgedetect: check if height is big enough
Fixes #8260 (cherry picked from commit ccf4ab8c9aca0aee66bcc2914031a9c97ac0eeb8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_edgedetect.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c
index a0ddcbbf5c..11a31fa4ff 100644
--- a/libavfilter/vf_edgedetect.c
+++ b/libavfilter/vf_edgedetect.c
@@ -150,7 +150,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];
@@ -180,8 +181,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 {