{"action":"created","issue":{"url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/issues/502","labels_url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/issues/502/comments","events_url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/issues/502/events","html_url":"https://github.com/ValyriaTear/ValyriaTear/pull/502","id":116677944,"number":502,"title":"Fixing a minor array indexing bug with greyscale textures.","user":{"login":"authenticate","id":4543259,"avatar_url":"https://avatars.githubusercontent.com/u/4543259?v=3","gravatar_id":"","url":"https://api.github.com/users/authenticate","html_url":"https://github.com/authenticate","followers_url":"https://api.github.com/users/authenticate/followers","following_url":"https://api.github.com/users/authenticate/following{/other_user}","gists_url":"https://api.github.com/users/authenticate/gists{/gist_id}","starred_url":"https://api.github.com/users/authenticate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/authenticate/subscriptions","organizations_url":"https://api.github.com/users/authenticate/orgs","repos_url":"https://api.github.com/users/authenticate/repos","events_url":"https://api.github.com/users/authenticate/events{/privacy}","received_events_url":"https://api.github.com/users/authenticate/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-13T01:05:35Z","updated_at":"2015-11-21T22:20:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/pulls/502","html_url":"https://github.com/ValyriaTear/ValyriaTear/pull/502","diff_url":"https://github.com/ValyriaTear/ValyriaTear/pull/502.diff","patch_url":"https://github.com/ValyriaTear/ValyriaTear/pull/502.patch"},"body":"Hi,\r\n\r\nThis is a minor update to fix an indexing issue.  The following line was out of bounds with the array:\r\n\r\n```C++\r\nuint8_t *end_position = &_pixels[_width * _height * format_bytes];\r\n```\r\n\r\n\"(_width * _height * format_bytes)\" is equal to the entire size of the array.  This will be one index too big.\r\n\r\nI also updated the looping structure.  I think the 'while' loop is clearer to the reader in this particular case since we are looping in groups of pixels instead of each index sequentially.\r\n\r\nLet me know if there are any issues.\r\n\r\nThanks.\r\n"},"comment":{"url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/issues/comments/158686481","html_url":"https://github.com/ValyriaTear/ValyriaTear/pull/502#issuecomment-158686481","issue_url":"https://api.github.com/repos/ValyriaTear/ValyriaTear/issues/502","id":158686481,"user":{"login":"authenticate","id":4543259,"avatar_url":"https://avatars.githubusercontent.com/u/4543259?v=3","gravatar_id":"","url":"https://api.github.com/users/authenticate","html_url":"https://github.com/authenticate","followers_url":"https://api.github.com/users/authenticate/followers","following_url":"https://api.github.com/users/authenticate/following{/other_user}","gists_url":"https://api.github.com/users/authenticate/gists{/gist_id}","starred_url":"https://api.github.com/users/authenticate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/authenticate/subscriptions","organizations_url":"https://api.github.com/users/authenticate/orgs","repos_url":"https://api.github.com/users/authenticate/repos","events_url":"https://api.github.com/users/authenticate/events{/privacy}","received_events_url":"https://api.github.com/users/authenticate/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T22:20:11Z","updated_at":"2015-11-21T22:20:11Z","body":"Sorry about that.\r\n\r\nI was storing the sum as an eight bit integer instead of a larger integer to hold the entire, scaled value.\r\n\r\nIn addition, I made a small change to the \"ListDirectory\" function for Windows.  It was not actually returning any files which caused the \"Debug Scripts\" menu option to never have any debug scripts.  I probably should have noticed that sooner.\r\n\r\nFinally, I changed \"data/debug\" to \"./data/debug\".  If this causes any problems on Linux or OS X, let me know and I'll revert it and change something else to make things work.  This just happened to be the simplest solution to get things moving at the time.\r\n\r\nThanks."}}