From 25a6caf0a338b61eb313ba2f81d03799ff063e23 Mon Sep 17 00:00:00 2001 From: xeon Date: Sun, 25 May 2025 19:18:07 +0300 Subject: [PATCH] fix: add null check for DitherConfig argument --- vivian/src/modules/censorship_patch.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vivian/src/modules/censorship_patch.rs b/vivian/src/modules/censorship_patch.rs index 4b98f4b..aed303e 100644 --- a/vivian/src/modules/censorship_patch.rs +++ b/vivian/src/modules/censorship_patch.rs @@ -34,8 +34,10 @@ impl NapModule for NapModuleContext { impl CensorshipPatch { pub unsafe extern "win64" fn on_set_dither_config(reg: *mut Registers, _: usize) { if LAST_ENTER_SCENE_TYPE.load(Ordering::SeqCst) == SCENE_TYPE_HALL { - println!("SetDitherConfig: disabling dither alpha"); - *(((*reg).rdx as *mut u8).wrapping_add(DITHER_CONFIG_AVATAR_USING_DITHER_ALPHA)) = 0; + if (*reg).rdx != 0 { + println!("SetDitherConfig: disabling dither alpha"); + *(((*reg).rdx as *mut u8).wrapping_add(DITHER_CONFIG_AVATAR_USING_DITHER_ALPHA)) = 0; + } } else { println!("SetDitherConfig: not in hall, ignoring"); }