projects
/
libguac-client-rdp.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e63d264
)
Fix boundary overflow.
author
Michael Jumper <zhangmaike@users.sourceforge.net>
Wed, 11 Apr 2012 04:40:05 +0000
(21:40 -0700)
committer
Michael Jumper <zhangmaike@users.sourceforge.net>
Wed, 11 Apr 2012 04:40:05 +0000
(21:40 -0700)
src/rdp_glyph.c
patch
|
blob
|
history
diff --git
a/src/rdp_glyph.c
b/src/rdp_glyph.c
index
603a104
..
951d8ec
100644
(file)
--- a/
src/rdp_glyph.c
+++ b/
src/rdp_glyph.c
@@
-207,6
+207,14
@@
void guac_rdp_glyph_enddraw(rdpContext* context,
cairo_surface_t* glyph_surface = guac_client_data->glyph_surface;
int stride = cairo_image_surface_get_stride(glyph_surface);
cairo_surface_t* glyph_surface = guac_client_data->glyph_surface;
int stride = cairo_image_surface_get_stride(glyph_surface);
+ /* Calculate bounds */
+ int max_width = cairo_image_surface_get_width(glyph_surface) - x;
+ int max_height = cairo_image_surface_get_height(glyph_surface) - y;
+
+ /* Ensure dimensions of glyph do not exceed bounds */
+ if (width > max_width) width = max_width;
+ if (height > max_height) height = max_height;
+
/* Ensure data is ready */
cairo_surface_flush(glyph_surface);
/* Ensure data is ready */
cairo_surface_flush(glyph_surface);