Bug 803791 - Guard against allocating a zero-capacity direct buffer. r=cpeterson
Back out 30b9fbf49c01:c7fc23428c3b (bug 823010) for being rotted by 8 hours

--HG--
extra : rebase_source : 0dde2f719d4963113b578d07a17a8001fb4e0f63