MFC r266798 and r266803:
Fix for big-endian architectures.

Approved by:    re, marius @