Merge "Fix a potential invalid memory access in non-RD coding flow"