Commit 8b2119e917 for ffmpeg
commit 8b2119e9174da2a10c203e8ea04d74319ad617c3
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Nov 7 00:23:02 2026 +0100
avfilter/vf_drawtext: do not shape the detection bbox text buffer at init
Fixes: heap-buffer-overflow (write)
Fixes: cstGjMaHQawL
Found during triage of the security report jBRKMspuGY2H
Out of array write Replicated through API with ASAN
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index ff3eefa3ae..758224d8ef 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1038,7 +1038,7 @@ static av_cold int init(AVFilterContext *ctx)
};
#if CONFIG_LIBFRIBIDI
- if (s->text_shaping)
+ if (s->text_shaping && s->text_source != AV_FRAME_DATA_DETECTION_BBOXES)
if ((err = shape_text(ctx)) < 0)
return err;
#endif