remain size to prvent MB residual reading overflow
Merge pull request #320 from huili2/mb_residual_size_check

remain size to prevent MB residual reading overflow