Code

Unions Are Evil! When pixblock size is TINY, it stores data right in the data.px...
[inkscape.git] / src / display / nr-filter.cpp
index f00a1ef6b3c922183250b0d911be3f33388a40f5..a720050c989b8a74899b4fde2637b85392bdf266 100644 (file)
@@ -161,7 +161,7 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb)
         nr_pixblock_setup_fast(in, pb->mode,
                                min_x, min_y,
                                max_x, max_y, true);
-        if (in->data.px == NULL) // memory allocation failed
+        if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) // memory allocation failed
             return 0;
         transform_nearest(in, pb, itrans);
     } else if (_x_pixels >= 0) {
@@ -191,7 +191,7 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb)
         }
         if (y_len < 1) y_len = 1;
         nr_pixblock_setup_fast(in, pb->mode, 0, 0, x_len, y_len, true);
-        if (in->data.px == NULL) // memory allocation failed
+        if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) // memory allocation failed
             return 0;
         scale_bicubic(in, pb);
         scale res_scaling(x_len / (double)(pb->area.x1 - pb->area.x0),
@@ -202,7 +202,7 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb)
         nr_pixblock_setup_fast(in, pb->mode,
                                pb->area.x0, pb->area.y0,
                                pb->area.x1, pb->area.y1, true);
-        if (in->data.px == NULL) // memory allocation failed
+        if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) // memory allocation failed
             return 0;
         nr_blit_pixblock_pixblock(in, pb);
     }