Encoder: avoid uint32 overflow when allocating memory for codestream buffer (fixes...