summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-07-01 18:03:12 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-07-06 13:34:37 +0200
commit6e9c02ab4fedd4f44e0cf3772350bb6c32c4a477 (patch)
tree2105f0546800560efe7d41c3d7a5106652c0e5d6
parent507d31982280185fe4d3fd22d25c6d11aad480c9 (diff)
downloadmupdf-6e9c02ab4fedd4f44e0cf3772350bb6c32c4a477.tar.xz
gl: Fix buffer overrun when there are too many annotations.
-rw-r--r--platform/gl/gl-main.c5
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;
+ }
}
}