Actually, this is checking that all frames use the same composite operation.

I think it's actually the comment that is wrong. I don't think we can skip accumulating if the common composite operation is 'replace'. The code doesn't, and I think that's correct.