decode: Initialize ret before using it