File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -5431,14 +5431,13 @@ fn read_hdlr<T: Read>(src: &mut BMFFBox<T>, strictness: ParseStrictness) -> Resu
5431
5431
5432
5432
match std:: str:: from_utf8 ( src. read_into_try_vec ( ) ?. as_slice ( ) ) {
5433
5433
Ok ( name) => {
5434
- match name. bytes ( ) . position ( |b| b == b'\0' ) {
5435
- None => fail_with_status_if (
5434
+ // `name` must be nul-terminated and any trailing bytes after the first nul ignored.
5435
+ // See https://github.com/MPEGGroup/FileFormat/issues/35
5436
+ if !name. bytes ( ) . any ( |b| b == b'\0' ) {
5437
+ fail_with_status_if (
5436
5438
strictness != ParseStrictness :: Permissive ,
5437
5439
Status :: HdlrNameNoNul ,
5438
- ) ?,
5439
- // `name` must be nul-terminated and any trailing bytes after the first nul ignored.
5440
- // See https://github.com/MPEGGroup/FileFormat/issues/35
5441
- Some ( _) => ( ) ,
5440
+ ) ?;
5442
5441
}
5443
5442
}
5444
5443
Err ( _) => fail_with_status_if (
You can’t perform that action at this time.
0 commit comments