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
In GeneralDataReader.h:GetKeyValFromLine
We parse the section "[playlist]" of generalData.ini
If most values are in the form of "key += Number" one valid entry is "playlist_reset = False"
We use "std::stoi" to convert numbers, however "False" is not a valid representation of a number.
Historically we used std::atoi which does not throw and return 0 in case of error.
std::atoi is useful for playlist_reset entry, but if we have an invalid "key += Number" entry it will silently fail and wrongly set 0 as value for the key.
I think we should handle the exception properly in case Number is invalid and generate meaningful error.
We could however ignore "playlist_reset" line entirely either inside GetKeyValFromLine and return {"", 0} or not call GetKeyValFromLine for playlist_reset line.
Fix should be applied to 1.3.0 release. Check 1.2.x version if bug is present too.
The text was updated successfully, but these errors were encountered:
Fix#864
Properly handle data and avoid exception thrown when reading not
numerical values with stoi when reading "playlist_reset" entry in
general_data.ini
---------
Co-authored-by: Florian Omnès <[email protected]>
(cherry picked from commit caf2805)
Fix#864
Properly handle data and avoid exception thrown when reading not
numerical values with stoi when reading "playlist_reset" entry in
general_data.ini
---------
Co-authored-by: Florian Omnès <[email protected]>
(cherry picked from commit caf2805)
In GeneralDataReader.h:GetKeyValFromLine
We parse the section "[playlist]" of generalData.ini
If most values are in the form of "key += Number" one valid entry is "playlist_reset = False"
We use "std::stoi" to convert numbers, however "False" is not a valid representation of a number.
Historically we used std::atoi which does not throw and return 0 in case of error.
std::atoi is useful for playlist_reset entry, but if we have an invalid "key += Number" entry it will silently fail and wrongly set 0 as value for the key.
I think we should handle the exception properly in case Number is invalid and generate meaningful error.
We could however ignore "playlist_reset" line entirely either inside GetKeyValFromLine and return {"", 0} or not call GetKeyValFromLine for playlist_reset line.
Fix should be applied to 1.3.0 release. Check 1.2.x version if bug is present too.
The text was updated successfully, but these errors were encountered: