garbear / xbmc

XBMC Main Repository
http://xbmc.org
Other
134 stars 53 forks source link

[gameclient] Fix vfs file length check #9

Closed fetzerch closed 11 years ago

fetzerch commented 11 years ago

Type size_t is unsigned. Therefore the value std::numeric_limits::max() casted to a signed type (long long) might be interpreted as -1 (depending on the system). This causes the length check to fail incorrectly.

The patch fixes an issue that games fail to be loaded from vfs on 64 bit Linux with the message: 'ERROR: GameClient: Invalid file size XY bytes'

Nice work btw! I hope I got the correct dev branch. If not feel free to cherry-pick wherever this is needed.

garbear commented 11 years ago

Cherry-picked by hand as 5ce90f92f9d74f4378350349b7b0754a77b28188. Cheers!