-
Notifications
You must be signed in to change notification settings - Fork 12
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
Potentially uninitialized local variable used partition
#10
Comments
Hi! All modes < 10 get their partition from the bitstream, and every mode >= 10 is using partition 0. |
Actually, to play it safe I can just init partition to 0 at start and then read it from bitstream for modes that require it. This should make any compiler happy :) |
Should be resolved by 026acf9. |
Perfect, this fixes it nicely! Thank you so much. We use the latest MSVC (C++23) to compile this library as part of our engine for Windows, and clang v14 for Linux, for future reference. |
Hello! Your library is excellent and I wanted to report this warning we got from integrating bcdec into our engine.
Warning C4701 potentially uninitialized local variable 'partition'
https://github.com/iOrange/bcdec/blob/main/bcdec.h#L870
It seems like there's a very rare case that could happen where partition is uninitialized. I noticed the if-else block above on L829 sets it to 0 but only in the if, not the else. I'm not too knowledgeable on BC formats so I wouldn't know what the proper value to set it here would be, hence me reporting this warning we get in an issue rather than submitting a PR. 😅
The text was updated successfully, but these errors were encountered: