| ... | ... | @@ -380,7 +380,7 @@ pub const FrameContext = struct { |
| 380 | 380 | /// - `error.WindowSizeUnknown` if the frame does not have a valid window |
| 381 | 381 | /// size |
| 382 | 382 | /// - `error.WindowTooLarge` if the window size is larger than |
| 383 | | /// `window_size_max` |
| 383 | /// `window_size_max` or `std.math.intMax(usize)` |
| 384 | 384 | /// - `error.ContentSizeTooLarge` if the frame header indicates a content |
| 385 | 385 | /// size larger than `std.math.maxInt(usize)` |
| 386 | 386 | pub fn init( |
| ... | ... | @@ -395,7 +395,7 @@ pub const FrameContext = struct { |
| 395 | 395 | const window_size = if (window_size_raw > window_size_max) |
| 396 | 396 | return error.WindowTooLarge |
| 397 | 397 | else |
| 398 | | @as(usize, @intCast(window_size_raw)); |
| 398 | std.math.cast(usize, window_size_raw) orelse return error.WindowTooLarge; |
| 399 | 399 | |
| 400 | 400 | const should_compute_checksum = |
| 401 | 401 | frame_header.descriptor.content_checksum_flag and verify_checksum; |