From 6e9c02ab4fedd4f44e0cf3772350bb6c32c4a477 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 1 Jul 2016 18:03:12 +0200 Subject: gl: Fix buffer overrun when there are too many annotations. --- platform/gl/gl-main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c index e6a93680..ab8641b1 100644 --- a/platform/gl/gl-main.c +++ b/platform/gl/gl-main.c @@ -273,6 +273,11 @@ void render_page(void) pix = fz_new_pixmap_from_annot(ctx, annot, &page_ctm, fz_device_rgb(ctx), 1); texture_from_pixmap(&annot_tex[annot_count++], pix); fz_drop_pixmap(ctx, pix); + if (annot_count >= nelem(annot_tex)) + { + fz_warn(ctx, "too many annotations to display!"); + break; + } } } -- cgit v1.2.3