From 9a2bcb294fb75bdfe1c4af93795ca874d1bbca87 Mon Sep 17 00:00:00 2001 From: bulia byak Date: Sun, 4 Feb 2007 15:10:56 +0000 Subject: Unions Are Evil! When pixblock size is TINY, it stores data right in the data.px field (as data.p) and clears it, so when read as data.px it yields NULL. This fixes the problems with the dropper tool (which uses tiny buffers) (bzr r2325) --- src/display/nr-arena-shape.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/display/nr-arena-shape.cpp') diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp index b2003b9e1..d539d0f13 100644 --- a/src/display/nr-arena-shape.cpp +++ b/src/display/nr-arena-shape.cpp @@ -756,7 +756,7 @@ nr_arena_shape_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned nr_pixblock_setup_fast(&m, NR_PIXBLOCK_MODE_A8, area->x0, area->y0, area->x1, area->y1, TRUE); // if memory allocation failed, abort render - if (m.data.px == NULL) { + if (m.size != NR_PIXBLOCK_SIZE_TINY && m.data.px == NULL) { nr_pixblock_release (&m); return (item->state); } @@ -794,7 +794,7 @@ nr_arena_shape_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned nr_pixblock_setup_fast(&m, NR_PIXBLOCK_MODE_A8, area->x0, area->y0, area->x1, area->y1, TRUE); // if memory allocation failed, abort render - if (m.data.px == NULL) { + if (m.size != NR_PIXBLOCK_SIZE_TINY && m.data.px == NULL) { nr_pixblock_release (&m); return (item->state); } @@ -859,7 +859,7 @@ nr_arena_shape_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb) nr_pixblock_setup_fast(&m, NR_PIXBLOCK_MODE_A8, area->x0, area->y0, area->x1, area->y1, TRUE); // if memory allocation failed, abort - if (m.data.px == NULL) { + if (m.size != NR_PIXBLOCK_SIZE_TINY && m.data.px == NULL) { nr_pixblock_release (&m); return (item->state); } -- cgit v1.2.3