opj_j2k_write_sod(): avoid potential heap buffer overflow (fixes #1299) (probably...