KEMBAR78
VIDEO: Fix signed/unsigned mismatch potentially breaking DXA seek. by elasota · Pull Request #4897 · scummvm/scummvm · GitHub
Skip to content

Conversation

@elasota
Copy link
Contributor

@elasota elasota commented Apr 10, 2023

Fixes VS warning that can potentially cause wrong behavior in DXA decoder:
dxa_decoder.cpp(72,18): warning C4245: 'argument': conversion from 'int' to 'uint32', signed/unsigned mismatch

skip accepts a uint32 parameter and then passes it to seek which accepts an int64. This is problematic because converting -4 to a uint32 may cause it to become 4294967292, causing the seek to fail if the underlying stream doesn't demote it back to 32-bit.

@ccawley2011
Copy link
Member

This looks OK, but I'd also recommend changing the skip function to use a 64-bit parameter, as it looks like something that was missed when 64-bit file I/O was first added. That can be done later in a separate PR, though.

@sev-
Copy link
Member

sev- commented Apr 29, 2023

Thanks!

@sev- sev- merged commit f7457c7 into scummvm:master Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants