Under load, the SD808 can get pretty warm.
Add to that the fact that MIUI (in all of its various forms) is a steaming, overheated pile of rhinoceros feces and you have a terrible combination just asking for heating problems.
TS CM13 does a pretty good job of mitigating the software issues...