Commit 6addaeb55e for ffmpeg
commit 6addaeb55e2b8d8fa7f33d06ebfb49ea49299611
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Nov 7 00:40:56 2026 +0100
avfilter/vf_drawtext: do not reload the text file with a detection bbox text source
The documentation says that textfile is ignored when text_source is set
Fixes: heap-buffer-overflow (write)
Fixes: cg1JrtNAcnk5
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 758224d8ef..515bc2c574 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -1907,7 +1907,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
}
}
- if (s->reload && !(inl->frame_count_out % s->reload)) {
+ if (s->reload && s->text_source != AV_FRAME_DATA_DETECTION_BBOXES &&
+ !(inl->frame_count_out % s->reload)) {
if ((ret = ff_load_textfile(ctx, (const char *)s->textfile, &s->text, NULL)) < 0) {
av_frame_free(&frame);
return ret;