You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code mixes doubles and integers in an odd way; I do not know if the tk->w * tk->h multiplication can overflow the integer values or not. The tk->CbCr_subsampling_dx * tk->CbCr_subsampling_dy step is probably carried out as integers, and thus a 0 result here is possible.
Floating point is difficult enough already without using integers in the same expressions. I'd feel much more confident about the safety of this code if it were re-written to avoid mixing types and was prepared to handle the potential integer overflows in the multiplications.
openjpeg/src/lib/openmj2/mj2_convert.c
Line 53 in da5e897
Hello,
This code mixes doubles and integers in an odd way; I do not know if the
tk->w * tk->h
multiplication can overflow the integer values or not. Thetk->CbCr_subsampling_dx * tk->CbCr_subsampling_dy
step is probably carried out as integers, and thus a0
result here is possible.Floating point is difficult enough already without using integers in the same expressions. I'd feel much more confident about the safety of this code if it were re-written to avoid mixing types and was prepared to handle the potential integer overflows in the multiplications.
Thanks
The text was updated successfully, but these errors were encountered: