Bug 1064864. Ensure the copying bounds are sane. r=jrmuizel a=sylvestre

This prevents things from going really bad on some drivers.

--HG--
branch : GECKO331_2014103013_RELBRANCH