diff options
Diffstat (limited to 'base/gsptype1.c')
-rw-r--r-- | base/gsptype1.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/base/gsptype1.c b/base/gsptype1.c index 28a88d02..2e032716 100644 --- a/base/gsptype1.c +++ b/base/gsptype1.c @@ -227,13 +227,14 @@ gs_pattern1_make_pattern(gs_client_color * pcc, * losing content. */ inst.size.x = (int)floor(bbw+0.5); inst.size.y = (int)floor(bbh+0.5); - /* Ensure we never round down to 0. */ - if (bbw > 0 && inst.size.x == 0) - inst.size.x = 1; - if (bbh > 0 && inst.size.y == 0) - inst.size.y = 1; } + /* Ensure we never round down to 0. Or below zero (bug 705768). */ + if (inst.size.x <= 0) + inst.size.x = bbw > 0 ? 1 : 0; + if (inst.size.y <= 0) + inst.size.y = bbh > 0 ? 1 : 0; + /* After compute_inst_matrix above, we are guaranteed that * inst.step_matrix.xx > 0 and inst.step_matrix.yy > 0. * Similarly, we are guaranteed that inst.size.x >= 0 and @@ -1615,10 +1616,10 @@ gx_pattern_cache_lookup(gx_device_color * pdevc, const gs_gstate * pgs, return true; } if (pcache != 0) { - gx_color_tile *ctile = &pcache->tiles[id % pcache->num_tiles]; + gx_color_tile *ctile = gx_pattern_cache_find_tile_for_id(pcache, id); bool internal_accum = true; if (pgs->have_pattern_streams) { - int code = dev_proc(dev, dev_spec_op)(dev, gxdso_pattern_load, NULL, id); + int code = dev_proc(dev, dev_spec_op)(dev, gxdso_pattern_load, &id, sizeof(gx_bitmap_id)); internal_accum = (code == 0); if (code < 0) return false; @@ -1960,7 +1961,7 @@ gx_dc_pattern_write( Just write the tile id. */ gs_id id = ptile->id; /* Ensure sizeof(gs_id). */ if_debug2m('v', dev->memory, - "[v*] Writing trans tile ID into clist, uid = %ld id = %ld \n", + "[v*] Writing trans tile ID into clist, uid = %ld id = %u \n", ptile->uid.id, ptile->id); memcpy(dp, &ptile->id, sizeof(id)); *psize = sizeof(gs_id); @@ -1972,7 +1973,7 @@ gx_dc_pattern_write( the clist */ if (ptile->ttrans != NULL) { if_debug2m('v', dev->memory, - "[v*] Writing trans tile into clist, uid = %ld id = %ld \n", + "[v*] Writing trans tile into clist, uid = %ld id = %u \n", ptile->uid.id, ptile->id); return gx_dc_pattern_trans_write_raster(ptile, offset, data, psize); } @@ -2286,7 +2287,7 @@ gx_dc_pattern_read( ptile->ttrans->deep = deep; pdevc->type = &gx_dc_pattern_trans; if_debug2m('v', pgs->memory, - "[v*] Reading trans tile from clist into cache, uid = %ld id = %ld \n", + "[v*] Reading trans tile from clist into cache, uid = %ld id = %u \n", ptile->uid.id, ptile->id); code = gx_dc_pattern_read_trans_buff(ptile, offset1, dp, left, mem); |