This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new c568f40597 avfilter/vf_codecview: Clamp block to the visible frame
region
c568f40597 is described below
commit c568f40597fc8a0a462fa08ed7d9de49c02cd80e
Author: Michael Niedermayer <[email protected]>
AuthorDate: Sat May 2 12:22:34 2026 +0200
Commit: michaelni <[email protected]>
CommitDate: Sun May 3 13:23:21 2026 +0000
avfilter/vf_codecview: Clamp block to the visible frame region
Fixes: write into the padding area of the frame
Found-by: Marius Momeu <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
---
libavfilter/vf_codecview.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c
index a4a701b00c..f20056b91b 100644
--- a/libavfilter/vf_codecview.c
+++ b/libavfilter/vf_codecview.c
@@ -266,9 +266,22 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
*frame)
if (par->nb_blocks) {
for (int block_idx = 0; block_idx < par->nb_blocks;
block_idx++) {
AVVideoBlockParams *b = av_video_enc_params_block(par,
block_idx);
- uint8_t *buf = frame->data[0] + b->src_y * stride;
- draw_block_rectangle(buf, b->src_x, b->src_y, b->w, b->h,
stride, 100);
+ int64_t x0 = b->src_x;
+ int64_t y0 = b->src_y;
+ int64_t x1 = x0 + b->w;
+ int64_t y1 = y0 + b->h;
+
+ x0 = FFMAX(x0, 0);
+ y0 = FFMAX(y0, 0);
+ x1 = FFMIN(x1, frame->width);
+ y1 = FFMIN(y1, frame->height);
+
+ if (x1 <= x0 || y1 <= y0)
+ continue;
+
+ uint8_t *buf = frame->data[0] + y0 * stride;
+ draw_block_rectangle(buf, x0, y0, x1-x0, y1-y0, stride,
100);
}
}
}
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]