Backport 940100c28ae28931722290794889cf84a92c5f6f from libopenjpeg20

Original commit message:

> Fix potential use-after-free in opj_j2k_write_mco function
>
> Fixes #563

Bug: 35443562
Change-Id: Ie46b9904a9d7bfb794c90c16e700cdede2a9dac4
(cherry picked from commit 76dddd89a6ff9b6104c408aac391f1877b173140)
1 file changed