1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-04 11:04:07 +02:00

verify lump size before reading

This commit is contained in:
Robin Appelman 2022-02-20 16:39:31 +01:00
commit 65af835320
2 changed files with 11 additions and 0 deletions

View file

@ -9,6 +9,11 @@ pub enum BspError {
UnexpectedHeader(Header),
#[error("bsp lump is out of bounds of the bsp file")]
LumpOutOfBounds(LumpEntry),
#[error("Invalid lump size, lump size {lump_size} is not a multiple of the element size {element_size}")]
InvalidLumpSize {
element_size: usize,
lump_size: usize,
},
#[error("unexpected length of uncompressed lump, got {got} but expected {expected}")]
UnexpectedUncompressedLumpSize { got: u32, expected: u32 },
#[error("error while decompressing lump")]