you should clamp the coords to the bitmap size too

var texX = clamp ( mouse_pos.x - hitMap.pos_x, 0, bmap_width(hiMap)-1 );
var texY = clamp ( mouse_pos.y - hitMap.pos_y, 0, bmap_height(hitMap)-1 );