aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2019-10-13 23:10:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-05-04 18:37:42 +0200
commitea5d154845dfc1c6e550d197d7da79aee87c9f66 (patch)
tree831403e79d503bbdef67ab843dec63c2101a79d9
parent93ad1e4a9f17ac5145c2957bb270a454c8a0cefd (diff)
downloadffmpeg-ea5d154845dfc1c6e550d197d7da79aee87c9f66.tar.gz
avfilter/vf_fieldorder: fix heap-buffer overflow
Fixes #8264 (cherry picked from commit 07050d7bdc32d82e53ee5bb727f5882323d00dba) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_fieldorder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c
index d0d68071fd..594fc4674b 100644
--- a/libavfilter/vf_fieldorder.c
+++ b/libavfilter/vf_fieldorder.c
@@ -109,8 +109,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
s->dst_tff ? "up" : "down");
h = frame->height;
for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++) {
- dst_line_step = out->linesize[plane];
- src_line_step = frame->linesize[plane];
+ dst_line_step = out->linesize[plane] * (h > 2);
+ src_line_step = frame->linesize[plane] * (h > 2);
line_size = s->line_size[plane];
dst = out->data[plane];
src = frame->data[plane];