use wrapping_add here so this doesn't panic when loading non-.dat data
This commit is contained in:
parent
9dc6e0815e
commit
d27d9ad072
|
@ -201,7 +201,7 @@ impl QuestDat {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if table_size != table_body_size + QUEST_DAT_TABLE_HEADER_SIZE as u32 {
|
if table_size != table_body_size.wrapping_add(QUEST_DAT_TABLE_HEADER_SIZE as u32) {
|
||||||
return Err(QuestDatError::DataFormatError(format!(
|
return Err(QuestDatError::DataFormatError(format!(
|
||||||
"Malformed table at index {}. table_size != table_body_size + 16",
|
"Malformed table at index {}. table_size != table_body_size + 16",
|
||||||
index
|
index
|
||||||
|
|
Loading…
Reference in a new issue