]> git.sesse.net Git - vlc/commitdiff
macosx: fix int overflow when editing bookmarks
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Tue, 6 Jan 2015 11:47:31 +0000 (12:47 +0100)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Tue, 6 Jan 2015 11:49:03 +0000 (12:49 +0100)
This caused incorrect values for larger bookmarks.

modules/gui/macosx/bookmarks.m

index a322cdda2cc9a3066161b9cb55cb56f67d7555bd..cd31646471239a0f72827fa2c8a2fff0c4473dbc 100644 (file)
@@ -253,11 +253,11 @@ static VLCBookmarks *_o_sharedInstance = nil;
     NSArray * components = [[o_edit_fld_time stringValue] componentsSeparatedByString:@":"];
     NSUInteger componentCount = [components count];
     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)
-        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)
-        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 {
         msg_Err(VLCIntf, "Invalid string format for time");
         goto clear;