fix byte buffer overflow caused by wrong size info
Merge pull request #209 from xiliu82/branch-0.8

fix byte buffer overflow caused by wrong size info