summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-05 00:13:01 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-05 00:19:56 (GMT)
commitb80d1765a08cdc68955b5afdc33e28c55aac3f04 (patch)
tree701c48ff3ed00925c211897e8efd2574aedd7ebd /gfx
parent5c89ce5a6adafcd594d4bcd84537fbed683912fd (diff)
downloadeeshow-b80d1765a08cdc68955b5afdc33e28c55aac3f04.zip
eeshow-b80d1765a08cdc68955b5afdc33e28c55aac3f04.tar.gz
eeshow-b80d1765a08cdc68955b5afdc33e28c55aac3f04.tar.bz2
gfx/cro.c (cro_img_end): let's try this again, slowly ...
Sigh, the things pollen allergy does to the human brain :-( Two bugs there: - updating the width after calculating the stride size is not such a good idea, and - forgetting that these are not values but pointers is even worse.
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 27bf437..492e63f 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -746,12 +746,12 @@ uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride)
end_common(cc, w, h, NULL, NULL);
+ *w += 2; /* line width */
+ *h += 2;
+
*stride = cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, *w);
data = alloc_size(*stride * *h);
- w += 2; /* line width */
- h += 2;
-
cc->s = cairo_image_surface_create_for_data((unsigned char *) data,
CAIRO_FORMAT_RGB24, *w, *h, *stride);
cc->cr = cairo_create(cc->s);