JP2: prevent potential write access violation (fixes issue 2591)