diff --git a/crates/voicevox_core_c_api/src/lib.rs b/crates/voicevox_core_c_api/src/lib.rs index abe83ca3a..d4ea8d7a3 100644 --- a/crates/voicevox_core_c_api/src/lib.rs +++ b/crates/voicevox_core_c_api/src/lib.rs @@ -1061,7 +1061,7 @@ pub unsafe extern "C" fn voicevox_user_dict_add_word( output_word_uuid: NonNull<[u8; 16]>, ) -> VoicevoxResultCode { into_result_code_with_error((|| { - let word = (*word).try_into_word()?; + let word = word.read_unaligned().try_into_word()?; let uuid = { let mut dict = user_dict.dict.lock().expect("lock failed"); dict.add_word(word)? @@ -1092,7 +1092,7 @@ pub unsafe extern "C" fn voicevox_user_dict_update_word( ) -> VoicevoxResultCode { into_result_code_with_error((|| { let word_uuid = Uuid::from_slice(word_uuid).map_err(CApiError::InvalidUuid)?; - let word = (*word).try_into_word()?; + let word = word.read_unaligned().try_into_word()?; { let mut dict = user_dict.dict.lock().expect("lock failed"); dict.update_word(word_uuid, word)?;