-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing bounds-checks for VUI Bitstream Restriction Syntax Elements #55
Comments
This is indeed what more recent versions of the standard specify, e.g. from 2017, Looks like this changed at some point though. Bitstreams I've tested with use the value 16, and going back to a 2003 copy of the spec, it says 16, I don't know when this changed. It seems that to avoid rejecting real files, these checks should allow 16. |
Woah! Thanks for sharing this insight! Are you familiar with any other syntax elements that have become more restrictive across spec versions? |
I am not aware of other examples; but I would not have investigated if data already used in some tests hadn't been rejected by the new checks. |
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 LevelThe text was updated successfully, but these errors were encountered: