codec.c: Defensively check the returned samples.