Confirmed, I'll look into it. I guess this applies to every camera, I don't really know any S5-specific hook that would cause this.
Edit: fixed the problem in my dev-trunk, return value of the read call is -1 at EOF, not 0 as assumed. Changed it to ss>0 which should be compatible with old behaviour, if any cameras return 0 instead of -1. I'll commit it to SVN in a minute.