Out of bounds write in canvas.toDataURL