@@ -401,7 +401,7 @@ pub struct SequenceHeaderObu {
401401 pub max_frame_width_minus_1 : u16 ,
402402 /// Specifies the maximum frame height minus 1 for the frames represented by
403403 /// this sequence header.
404- pub max_frame_height_minus_1 : u32 ,
404+ pub max_frame_height_minus_1 : u16 ,
405405 /// Specifies whether frame id numbers are present in the coded video
406406 /// sequence.
407407 pub frame_id_numbers_present_flag : bool ,
@@ -1394,7 +1394,7 @@ impl Parser {
13941394 fh. frame_height = r. read_bits ( n) ? + 1 ;
13951395 } else {
13961396 fh. frame_width = seq. max_frame_width_minus_1 as u32 + 1 ;
1397- fh. frame_height = seq. max_frame_height_minus_1 + 1 ;
1397+ fh. frame_height = seq. max_frame_height_minus_1 as u32 + 1 ;
13981398 }
13991399
14001400 Self :: parse_superres_params ( fh, r, seq) ?;
@@ -1825,7 +1825,8 @@ impl Parser {
18251825 s. frame_height_bits_minus_1 = r. read_bits ( 4 ) ? as u8 ;
18261826 // frame_width_bits_minus_1 has been read from 4 bits, meaning we can read 16 bits at most.
18271827 s. max_frame_width_minus_1 = r. read_bits ( s. frame_width_bits_minus_1 + 1 ) ? as u16 ;
1828- s. max_frame_height_minus_1 = r. read_bits ( s. frame_height_bits_minus_1 + 1 ) ?;
1828+ // frame_height_bits_minus_1 has been read from 4 bits, meaning we can read 16 bits at most.
1829+ s. max_frame_height_minus_1 = r. read_bits ( s. frame_height_bits_minus_1 + 1 ) ? as u16 ;
18291830 if s. reduced_still_picture_header {
18301831 s. frame_id_numbers_present_flag = false ;
18311832 } else {
0 commit comments