-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Labels
Description
By convention, the check_parser_state
macro is called at the end of while
loops for iterating over BMFFBox
's sub boxes with BoxIter
like so:
let mut iter = src.box_iter();
while let Some(mut b) = iter.next_box()? {
// read or skip all the contents of `b`
check_parser_state!(b.content);
}
This helps to surface the situation of failing to read boxes in their entirety either due to logic errors or malformed input. However, it can be easy to forget to add the check_parser_state
macro in the appropriate place, so some form of automation would improve the robustness of the codebase.