h264-reader icon indicating copy to clipboard operation
h264-reader copied to clipboard

Missing bounds-checks for VUI Bitstream Restriction Syntax Elements

Open wrv opened this issue 11 months ago • 3 comments

The VUI bitstream restriction syntax elements are not bounds checked: https://github.com/dholroyd/h264-reader/blob/master/src/nal/sps.rs#L803-L812

Expected bounds, according to Annex E.2.1 of the spec:

  • max_bytes_per_pic_denom: [0, 16]
  • max_bits_per_mb_denom: [0, 16]
  • log2_max_mv_length_horizontal: [0, 15]
  • log2_max_mv_length_vertical: [0, 15]
  • max_num_reorder_frames: [0, max_dec_frame_buffering]
  • max_dec_frame_buffering: [max_num_reorder_frames, MaxDpbFrames] where MaxDpbFrames is set by the Level

wrv avatar Jul 19 '23 16:07 wrv