-
Notifications
You must be signed in to change notification settings - Fork 28
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
Panic from 'attempt to add with overflow' in qs_y calculation #58
Comments
To produce the PoC video with H26Forge, you can use the following transform: ##
# Overflows a qs_y calculation, triggering potential issues while decoding
#
# Save this file as `overflowing_qs_y.py`
# Run with `./h26forge modify -i input_vids/SPS_PPS_I_P.264 -o overflowing_qs_y.264 -t overflowing_qs_y.py`
#
def overflow_qs_y(ds):
ds["ppses"][0]["pic_init_qs_minus26"] = -285
# SI slice
ds["slices"][0]["sh"]["slice_type"] = 4
ds["slices"][0]["sh"]["slice_qs_delta"] = -2147483645
return ds
def modify_video(ds):
return overflow_qs_y(ds) |
dholroyd
added a commit
that referenced
this issue
Feb 26, 2024
dholroyd
added a commit
that referenced
this issue
Feb 27, 2024
dholroyd
added a commit
that referenced
this issue
Feb 29, 2024
dholroyd
added a commit
that referenced
this issue
Mar 1, 2024
dholroyd
added a commit
that referenced
this issue
Mar 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/dholroyd/h264-reader/blob/8cae2315eee5796b297a412d388c7cf797b386da/src/nal/slice/mod.rs#L602C74-L602C74
A missing bounds check in
pps.pic_init_qs_minus26
can cause an overflow when calculatingqs_y
.Here is an input with
pps.pic_init_qs_minus26
set to-285
andslice_qs_delta
set to-2147483645
:The syntax element
pps.pic_init_qs_minus26
should be in the range [-26, 25].Found with H26Forge.
The text was updated successfully, but these errors were encountered: