Skip to content

Commit 724bcc1

Browse files
committed
Return error if iloc box contains duplicate item_ID
Resolves https://oss-fuzz.com/testcase-detail/5639655386775552
1 parent 4d48ff9 commit 724bcc1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mp4parse/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,14 @@ fn read_iloc<T: Read>(src: &mut BMFFBox<T>) -> Result<TryVec<ItemLocationBoxItem
22262226
extents.push(extent)?;
22272227
}
22282228

2229+
// TODO: change items to TryHashMap once https://github.com/vcombey/fallible_collections/pull/12 merges
2230+
if items
2231+
.iter()
2232+
.any(|prev_item: &ItemLocationBoxItem| prev_item.item_id == item_id)
2233+
{
2234+
return Err(Error::InvalidData("duplicate item_ID in iloc"));
2235+
}
2236+
22292237
items.push(ItemLocationBoxItem {
22302238
item_id,
22312239
construction_method,

0 commit comments

Comments
 (0)