add return value processing
Merge pull request #1526 from ruil2/max_nal_size

add return value processing