rmdec: stricter error check to avoid theoretical unitialized use