{"action":"closed","issue":{"url":"https://api.github.com/repos/uclouvain/openjpeg/issues/515","labels_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/515/labels{/name}","comments_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/515/comments","events_url":"https://api.github.com/repos/uclouvain/openjpeg/issues/515/events","html_url":"https://github.com/uclouvain/openjpeg/issues/515","id":89723790,"number":515,"title":"opj_uint_adds()  is questionable","user":{"login":"szukw000","id":5041293,"avatar_url":"https://avatars.githubusercontent.com/u/5041293?v=3","gravatar_id":"","url":"https://api.github.com/users/szukw000","html_url":"https://github.com/szukw000","followers_url":"https://api.github.com/users/szukw000/followers","following_url":"https://api.github.com/users/szukw000/following{/other_user}","gists_url":"https://api.github.com/users/szukw000/gists{/gist_id}","starred_url":"https://api.github.com/users/szukw000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szukw000/subscriptions","organizations_url":"https://api.github.com/users/szukw000/orgs","repos_url":"https://api.github.com/users/szukw000/repos","events_url":"https://api.github.com/users/szukw000/events{/privacy}","received_events_url":"https://api.github.com/users/szukw000/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-20T05:59:56Z","updated_at":"2015-06-20T11:03:30Z","closed_at":"2015-06-20T11:03:30Z","body":"'opj_uintmath.h' contains the lines:\r\n\r\n/**\r\n Get the saturated sum of two unsigned integers\r\n @return Returns saturated sum of a+b\r\n */\r\nstatic INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b) {\r\n    OPJ_UINT64 sum = (OPJ_UINT64)a + (OPJ_UINT64)b;\r\n    return -(OPJ_UINT32)(sum >> 32) | (OPJ_UINT32)sum;\r\n}\r\n\r\n'opj_uint_adds()' is always the first value of:\r\n\r\nstatic INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b) {\r\n    return a < b ? a : b;\r\n}\r\n\r\nThis means: the value returned MUST not be negative.\r\n\r\nShould the '-' sign in 'opj_uint_adds()' be removed?\r\n\r\nwinfried"}}