Author: jhinrichs
Date: Fri Feb 6 01:39:57 2009
New Revision: 32621
URL: http://svn.gna.org/viewcvs/wesnoth?rev=32621&view=rev
Log: (empty)
Modified:
trunk/src/text.cpp
Modified: trunk/src/text.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/text.cpp?rev=32621&r1=32620&r2=32621&view=diff
==============================================================================
--- trunk/src/text.cpp (original)
+++ trunk/src/text.cpp Fri Feb 6 01:39:57 2009
@@ -461,8 +461,8 @@
const unsigned width = rect_.x + rect_.width;
const unsigned height = rect_.y + rect_.height;
- const unsigned stride = width * 4;
- create_surface_buffer(stride * height);
+ const unsigned stride = (width+1) * 4;
+ create_surface_buffer(stride * (height+1));
cairo_surface_t *cairo_surface =
cairo_image_surface_create_for_data(surface_buffer_,
@@ -488,6 +488,8 @@
for(size_t y = 0; y < height; ++y) {
for(size_t x = 0; x < width; ++x) {
+ if ( (y*width + x) * 4 > surface_buffer_.size())
+ y = y - 1;
unsigned char *pixel = &surface_buffer_[(y *
width + x) * 4];
// Assume everything not compiled with gcc to be on a little endian platform.
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits