[vlc-commits] macosx: fix int overflow when editing bookmarks

David Fuhrmann git at videolan.org
Tue Jan 6 12:49:10 CET 2015


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Tue Jan  6 12:47:31 2015 +0100| [7cf1d8017affd7baf7e3e29a68d8df52e4816c2f] | committer: David Fuhrmann

macosx: fix int overflow when editing bookmarks

This caused incorrect values for larger bookmarks.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7cf1d8017affd7baf7e3e29a68d8df52e4816c2f
---

 modules/gui/macosx/bookmarks.m |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/bookmarks.m b/modules/gui/macosx/bookmarks.m
index a322cdd..cd31646 100644
--- a/modules/gui/macosx/bookmarks.m
+++ b/modules/gui/macosx/bookmarks.m
@@ -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;



More information about the vlc-commits mailing list