I have been experiencing problems with icons in the dock. When I open an application that is not in the dock (e.g. from the finder), a transparent square appears. Same thing happens in the application switcher (i.e. command + tab).
Are you using a Macbook/ Macbook pro? I had this problem once before. As each time I simply closed the lid, a simple restart solved the problems. I find if you're using a Macbook pro you should probably restart it after uptime of approx 20-25 days.