Fail to parse .ass file when some margin is not an integer
If a margin value in a .ass file is not an integer, eg. it is empty (",,") or a float (",25.00,") the parser fails with a "bad lexical cast" error.
Please find attached a minimal file to reproduce (had to change the ext to ".txt" for GitHub to accept it).
I already have a working fix. Pull request incoming.
Ideally this should match the libass implementation, which also allows for leading space, as well as (somewhat bizarrely) hexadecimal; and returns 0 when it fails to parse an integer from the content
Ideally this should match the libass implementation, which also allows for leading space, as well as (somewhat bizarrely) hexadecimal; and returns 0 when it fails to parse an integer from the content
Not the case in my PR. I can change it to match this behavior.
PR updated
Should match the wanted behavior. Could have been much simple using std::stoi with base=0, but this would have lead to values with leading 0 be read as base 8, which is not wanted.
Updated test file