avcodec/loco: Check for end of input in the first line