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
As of v0.17.14, the OutputInfo struct has a pub field line_size that seems to be computed entirely from other fields - namely width, height and bit depth.
Since the field is public, it is possible for the API user to mutate it and put the whole OutputInfo in an inconsistent state where the values of the fields end up conflicting each other.
It would be nice to turn one of these fields into a method that computes data from the other values, so that it's no longer possible to create structs with conflicting values.
The text was updated successfully, but these errors were encountered:
The OutputInfo object is only returned from next_frame so it seems harmless to have all public fields. Though it is a bit awkward that it gets returned at the same time as the frame data, even though you have to pass in a properly sized &mut [u8] to the function in the first place
As of v0.17.14, the OutputInfo struct has a pub field
line_size
that seems to be computed entirely from other fields - namely width, height and bit depth.Since the field is public, it is possible for the API user to mutate it and put the whole
OutputInfo
in an inconsistent state where the values of the fields end up conflicting each other.It would be nice to turn one of these fields into a method that computes data from the other values, so that it's no longer possible to create structs with conflicting values.
The text was updated successfully, but these errors were encountered: