[FFmpeg-cvslog] avfilter/vf_swaprect: round coordinates down
Michael Niedermayer
git at videolan.org
Sun Apr 14 23:59:31 EEST 2024
ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Fri Dec 22 22:27:08 2023 +0100| [1b8ef074c1f3b0767a01025a1bfa2881496cf73f] | committer: Michael Niedermayer
avfilter/vf_swaprect: round coordinates down
Fixes: out of array access:
Fixes: tickets/10745/poc12ffmpeg
Found-by: Li Zeyuan and Zeng Yunxiang.
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 7deaca71b32c556620e05954ca2d13fbe9aacf1f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b8ef074c1f3b0767a01025a1bfa2881496cf73f
---
libavfilter/vf_swaprect.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libavfilter/vf_swaprect.c b/libavfilter/vf_swaprect.c
index 9f7b6f2ec8..86d69ff4d4 100644
--- a/libavfilter/vf_swaprect.c
+++ b/libavfilter/vf_swaprect.c
@@ -170,14 +170,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
lw[1] = lw[2] = FF_CEIL_RSHIFT(inlink->w, s->desc->log2_chroma_w);
lw[0] = lw[3] = inlink->w;
- x1[1] = x1[2] = FF_CEIL_RSHIFT(x1[0], s->desc->log2_chroma_w);
+ x1[1] = x1[2] = (x1[0] >> s->desc->log2_chroma_w);
x1[0] = x1[3] = x1[0];
- y1[1] = y1[2] = FF_CEIL_RSHIFT(y1[0], s->desc->log2_chroma_h);
+ y1[1] = y1[2] = (y1[0] >> s->desc->log2_chroma_h);
y1[0] = y1[3] = y1[0];
- x2[1] = x2[2] = FF_CEIL_RSHIFT(x2[0], s->desc->log2_chroma_w);
+ x2[1] = x2[2] = (x2[0] >> s->desc->log2_chroma_w);
x2[0] = x2[3] = x2[0];
- y2[1] = y2[2] = FF_CEIL_RSHIFT(y2[0], s->desc->log2_chroma_h);
+ y2[1] = y2[2] = (y2[0] >> s->desc->log2_chroma_h);
y2[0] = y2[3] = y2[0];
More information about the ffmpeg-cvslog
mailing list