From fc29f359f31095c544444d23403466fcbb22e953 Mon Sep 17 00:00:00 2001 From: Any <406088125@qq.com> Date: Fri, 3 Apr 2026 00:12:57 +0800 Subject: [PATCH] Fix out-of-bounds access in the bndCaretPosition->nvgTextGlyphPositions of the nanovg example. (#3650) --- examples/20-nanovg/blendish.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/20-nanovg/blendish.h b/examples/20-nanovg/blendish.h index a1c1d2d3f..c8d1034a0 100644 --- a/examples/20-nanovg/blendish.h +++ b/examples/20-nanovg/blendish.h @@ -2248,7 +2248,7 @@ static void bndCaretPosition(NVGcontext *ctx, float x, float y, if (nrows == 0) return; *cx = rows[r].minx; nglyphs = nvgTextGlyphPositions( - ctx, x, y, rows[r].start, rows[r].end+1, glyphs, BND_MAX_GLYPHS); + ctx, x, y, rows[r].start, rows[r].end, glyphs, BND_MAX_GLYPHS); for (int i=0; i < nglyphs; ++i) { *cx=glyphs[i].x; if (glyphs[i].str == caret) break;