Commit dd81ad912b for ffmpeg
commit dd81ad912b2761df6e6403ffa8690c49692ee7ec
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sun Nov 8 01:47:46 2026 +0100
avfilter/vf_drawtext: place the detection bbox text above boxes near the top
Fixes: signed integer overflow
Fixes: kBR11CyKAEHm
Fixes: repro_drawtext.c
Found-by: Hicham Ouabella <ouabe2002hisham@proton.me>
This is not a security issue.
Signed integer overflow Replicated through API with UBSAN
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 515bc2c574..da4f19ec8c 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1940,7 +1940,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
strcat(s->text, bbox->classify_labels[j]);
}
s->x = bbox->x;
- s->y = bbox->y - s->fontsize;
+ s->y = (int64_t)bbox->y - s->fontsize;
}
ret = draw_text(ctx, frame);
if (ret < 0) {