Bleh, so the unsigned LEB128 encode/decode work fine, bulletproof even. but for some reason the signed equivalents are just broken.
Signed encode can't encode non-negative value, and the decode always decodes and non-negative. I'm going mad here.
Welcome to your niu world ! We are a cute and loving international community Ｏ(≧▽≦)Ｏ !