diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-07-01 18:03:12 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-07-06 13:34:37 +0200 |
commit | 6e9c02ab4fedd4f44e0cf3772350bb6c32c4a477 (patch) | |
tree | 2105f0546800560efe7d41c3d7a5106652c0e5d6 | |
parent | 507d31982280185fe4d3fd22d25c6d11aad480c9 (diff) | |
download | mupdf-6e9c02ab4fedd4f44e0cf3772350bb6c32c4a477.tar.xz |
gl: Fix buffer overrun when there are too many annotations.
-rw-r--r-- | platform/gl/gl-main.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; + } } } |