Skip to content

Commit 7cf1d80

Browse files
author
David Fuhrmann
committed
macosx: fix int overflow when editing bookmarks
This caused incorrect values for larger bookmarks.
1 parent f205eb5 commit 7cf1d80

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/gui/macosx/bookmarks.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ - (IBAction)edit_ok:(id)sender
253253
NSArray * components = [[o_edit_fld_time stringValue] componentsSeparatedByString:@":"];
254254
NSUInteger componentCount = [components count];
255255
if (componentCount == 1)
256-
pp_bookmarks[i]->i_time_offset = 1000000 * ([[components objectAtIndex:0] intValue]);
256+
pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue]);
257257
else if (componentCount == 2)
258-
pp_bookmarks[i]->i_time_offset = 1000000 * ([[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]);
258+
pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]);
259259
else if (componentCount == 3)
260-
pp_bookmarks[i]->i_time_offset = 1000000 * ([[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]);
260+
pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] longLongValue]);
261261
else {
262262
msg_Err(VLCIntf, "Invalid string format for time");
263263
goto clear;

0 commit comments

Comments
 (0)