fix: DPI 스케일링 정밀도 개선 및 토큰 형식 검증

- DPI 계산을 float64 기반으로 변경하여 반올림 정확도 향상
- JWT 토큰 3-part 형식 사전 검증 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 21:40:12 +09:00
parent b71c0d7baf
commit 574a6ee277

View File

@@ -220,8 +220,9 @@ func getSystemDPI() uint32 {
} }
// dpiScale scales a base-96-DPI pixel value to the system DPI. // dpiScale scales a base-96-DPI pixel value to the system DPI.
// Uses floating-point to avoid precision loss on non-standard DPI values.
func dpiScale(px int, dpi uint32) uintptr { func dpiScale(px int, dpi uint32) uintptr {
return uintptr(px * int(dpi) / 96) return uintptr(int(float64(px)*float64(dpi)/96.0 + 0.5))
} }
// ── Font helpers ───────────────────────────────────────────────────────────── // ── Font helpers ─────────────────────────────────────────────────────────────
@@ -898,6 +899,10 @@ func handleURI(rawURI string) error {
if token == "" { if token == "" {
return fmt.Errorf("토큰이 없습니다") return fmt.Errorf("토큰이 없습니다")
} }
// JWT는 점(.)으로 구분된 3파트 형식이어야 함
if parts := strings.Split(token, "."); len(parts) != 3 {
return fmt.Errorf("유효하지 않은 토큰 형식입니다")
}
gameDir, err := installDir() gameDir, err := installDir()
if err != nil { if err != nil {