Commit 06cedbef authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix int overflow when editing bookmarks

This caused incorrect values for larger bookmarks.
parent 68ac288d
...@@ -253,11 +253,11 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -253,11 +253,11 @@ static VLCBookmarks *_o_sharedInstance = nil;
NSArray * components = [[o_edit_fld_time stringValue] componentsSeparatedByString:@":"]; NSArray * components = [[o_edit_fld_time stringValue] componentsSeparatedByString:@":"];
NSUInteger componentCount = [components count]; NSUInteger componentCount = [components count];
if (componentCount == 1) if (componentCount == 1)
pp_bookmarks[i]->i_time_offset = 1000000 * ([[components objectAtIndex:0] intValue]); pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue]);
else if (componentCount == 2) else if (componentCount == 2)
pp_bookmarks[i]->i_time_offset = 1000000 * ([[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]); pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]);
else if (componentCount == 3) else if (componentCount == 3)
pp_bookmarks[i]->i_time_offset = 1000000 * ([[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]); pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] longLongValue]);
else { else {
msg_Err(VLCIntf, "Invalid string format for time"); msg_Err(VLCIntf, "Invalid string format for time");
goto clear; goto clear;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment