In AVC format, NAL Units are accompanied with its length in 4 bytes, big endian.
Skipping first 2 bytes is invalid, because there may be valid non-zero bytes.
In order to convert AVC format to Annex-B byte stream, the program must read all 4 bytes as length and read that bytes as NAL unit.