{"action":"created","comment":{"url":"https://api.github.com/repos/csnover/scummvm/pulls/comments/91360019","pull_request_review_id":11869254,"id":91360019,"diff_hunk":"@@ -681,39 +655,40 @@ void GfxView::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCou\n \t}\n }\n \n-const byte *GfxView::getBitmap(int16 loopNo, int16 celNo) {\n-\tloopNo = CLIP<int16>(loopNo, 0, _loopCount -1);\n-\tcelNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);\n+const SciSpan<const byte> &GfxView::getBitmap(int16 loopNo, int16 celNo) {\n+\tloopNo = CLIP<int16>(loopNo, 0, _loop.size() - 1);\n+\tcelNo = CLIP<int16>(celNo, 0, _loop[loopNo].cel.size() - 1);\n \tif (_loop[loopNo].cel[celNo].rawBitmap)\n-\t\treturn _loop[loopNo].cel[celNo].rawBitmap;\n+\t\treturn *_loop[loopNo].cel[celNo].rawBitmap;\n \n \tuint16 width = _loop[loopNo].cel[celNo].width;\n \tuint16 height = _loop[loopNo].cel[celNo].height;\n \t// allocating memory to store cel's bitmap\n-\tint pixelCount = width * height;\n-\t_loop[loopNo].cel[celNo].rawBitmap = new byte[pixelCount];\n-\tbyte *pBitmap = _loop[loopNo].cel[celNo].rawBitmap;\n+\tconst uint pixelCount = width * height;\n+\t_loop[loopNo].cel[celNo].rawBitmap.allocate(pixelCount, _resource->getDescription() + Common::String::format(\" loop %d cel %d\", loopNo, celNo));\n+\tSciSpan<byte> rawBitmap = *_loop[loopNo].cel[celNo].rawBitmap;","path":"engines/sci/graphics/view.cpp","position":513,"original_position":513,"commit_id":"7b98b23ea82f5a6cdb6d5f5ed086bfe57617f643","original_commit_id":"7b98b23ea82f5a6cdb6d5f5ed086bfe57617f643","user":{"login":"csnover","id":229244,"avatar_url":"https://avatars.githubusercontent.com/u/229244?v=3","gravatar_id":"","url":"https://api.github.com/users/csnover","html_url":"https://github.com/csnover","followers_url":"https://api.github.com/users/csnover/followers","following_url":"https://api.github.com/users/csnover/following{/other_user}","gists_url":"https://api.github.com/users/csnover/gists{/gist_id}","starred_url":"https://api.github.com/users/csnover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnover/subscriptions","organizations_url":"https://api.github.com/users/csnover/orgs","repos_url":"https://api.github.com/users/csnover/repos","events_url":"https://api.github.com/users/csnover/events{/privacy}","received_events_url":"https://api.github.com/users/csnover/received_events","type":"User","site_admin":false},"body":"Once the bad implicit conversion is removed from Span, this could be changed to an explicit reinterpret_cast or C-cast to `SciSpan<byte> &`. `SpanOwner::allocate` could also be changed to return a non-const Span or raw pointer, to give write access to the caller without requiring manual allocation. Do either of these seem better? For some reason I am wary of a direct malloc here, but I will assent to it if these alternatives still look bad to you.","created_at":"2016-12-07T18:49:25Z","updated_at":"2016-12-07T18:49:25Z","html_url":"https://github.com/csnover/scummvm/pull/4#discussion_r91360019","pull_request_url":"https://api.github.com/repos/csnover/scummvm/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/csnover/scummvm/pulls/comments/91360019"},"html":{"href":"https://github.com/csnover/scummvm/pull/4#discussion_r91360019"},"pull_request":{"href":"https://api.github.com/repos/csnover/scummvm/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/csnover/scummvm/pulls/4","id":96406146,"html_url":"https://github.com/csnover/scummvm/pull/4","diff_url":"https://github.com/csnover/scummvm/pull/4.diff","patch_url":"https://github.com/csnover/scummvm/pull/4.patch","issue_url":"https://api.github.com/repos/csnover/scummvm/issues/4","number":4,"state":"open","locked":false,"title":"Bounds checking review","user":{"login":"csnover","id":229244,"avatar_url":"https://avatars.githubusercontent.com/u/229244?v=3","gravatar_id":"","url":"https://api.github.com/users/csnover","html_url":"https://github.com/csnover","followers_url":"https://api.github.com/users/csnover/followers","following_url":"https://api.github.com/users/csnover/following{/other_user}","gists_url":"https://api.github.com/users/csnover/gists{/gist_id}","starred_url":"https://api.github.com/users/csnover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnover/subscriptions","organizations_url":"https://api.github.com/users/csnover/orgs","repos_url":"https://api.github.com/users/csnover/repos","events_url":"https://api.github.com/users/csnover/events{/privacy}","received_events_url":"https://api.github.com/users/csnover/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-03T18:30:17Z","updated_at":"2016-12-07T18:49:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1ccbcff967b43511a606df62851f192118ec7d3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/csnover/scummvm/pulls/4/commits","review_comments_url":"https://api.github.com/repos/csnover/scummvm/pulls/4/comments","review_comment_url":"https://api.github.com/repos/csnover/scummvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csnover/scummvm/issues/4/comments","statuses_url":"https://api.github.com/repos/csnover/scummvm/statuses/7b98b23ea82f5a6cdb6d5f5ed086bfe57617f643","head":{"label":"csnover:bounds-checking-review","ref":"bounds-checking-review","sha":"7b98b23ea82f5a6cdb6d5f5ed086bfe57617f643","user":{"login":"csnover","id":229244,"avatar_url":"https://avatars.githubusercontent.com/u/229244?v=3","gravatar_id":"","url":"https://api.github.com/users/csnover","html_url":"https://github.com/csnover","followers_url":"https://api.github.com/users/csnover/followers","following_url":"https://api.github.com/users/csnover/following{/other_user}","gists_url":"https://api.github.com/users/csnover/gists{/gist_id}","starred_url":"https://api.github.com/users/csnover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnover/subscriptions","organizations_url":"https://api.github.com/users/csnover/orgs","repos_url":"https://api.github.com/users/csnover/repos","events_url":"https://api.github.com/users/csnover/events{/privacy}","received_events_url":"https://api.github.com/users/csnover/received_events","type":"User","site_admin":false},"repo":{"id":40680302,"name":"scummvm","full_name":"csnover/scummvm","owner":{"login":"csnover","id":229244,"avatar_url":"https://avatars.githubusercontent.com/u/229244?v=3","gravatar_id":"","url":"https://api.github.com/users/csnover","html_url":"https://github.com/csnover","followers_url":"https://api.github.com/users/csnover/followers","following_url":"https://api.github.com/users/csnover/following{/other_user}","gists_url":"https://api.github.com/users/csnover/gists{/gist_id}","starred_url":"https://api.github.com/users/csnover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnover/subscriptions","organizations_url":"https://api.github.com/users/csnover/orgs","repos_url":"https://api.github.com/users/csnover/repos","events_url":"https://api.github.com/users/csnover/events{/privacy}","received_events_url":"https://api.github.com/users/csnover/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csnover/scummvm","description":"ScummVM main repository","fork":true,"url":"https://api.github.com/repos/csnover/scummvm","forks_url":"https://api.github.com/repos/csnover/scummvm/forks","keys_url":"https://api.github.com/repos/csnover/scummvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csnover/scummvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csnover/scummvm/teams","hooks_url":"https://api.github.com/repos/csnover/scummvm/hooks","issue_events_url":"https://api.github.com/repos/csnover/scummvm/issues/events{/number}","events_url":"https://api.github.com/repos/csnover/scummvm/events","assignees_url":"https://api.github.com/repos/csnover/scummvm/assignees{/user}","branches_url":"https://api.github.com/repos/csnover/scummvm/branches{/branch}","tags_url":"https://api.github.com/repos/csnover/scummvm/tags","blobs_url":"https://api.github.com/repos/csnover/scummvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csnover/scummvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csnover/scummvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/csnover/scummvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csnover/scummvm/statuses/{sha}","languages_url":"https://api.github.com/repos/csnover/scummvm/languages","stargazers_url":"https://api.github.com/repos/csnover/scummvm/stargazers","contributors_url":"https://api.github.com/repos/csnover/scummvm/contributors","subscribers_url":"https://api.github.com/repos/csnover/scummvm/subscribers","subscription_url":"https://api.github.com/repos/csnover/scummvm/subscription","commits_url":"https://api.github.com/repos/csnover/scummvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/csnover/scummvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/csnover/scummvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/csnover/scummvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/csnover/scummvm/contents/{+path}","compare_url":"https://api.github.com/repos/csnover/scummvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csnover/scummvm/merges","archive_url":"https://api.github.com/repos/csnover/scummvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csnover/scummvm/downloads","issues_url":"https://api.github.com/repos/csnover/scummvm/issues{/number}","pulls_url":"https://api.github.com/repos/csnover/scummvm/pulls{/number}","milestones_url":"https://api.github.com/repos/csnover/scummvm/milestones{/number}","notifications_url":"https://api.github.com/repos/csnover/scummvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csnover/scummvm/labels{/name}","releases_url":"https://api.github.com/repos/csnover/scummvm/releases{/id}","deployments_url":"https://api.github.com/repos/csnover/scummvm/deployments","created_at":"2015-08-13T20:29:41Z","updated_at":"2016-02-16T22:52:47Z","pushed_at":"2016-12-07T15:38:31Z","git_url":"git://github.com/csnover/scummvm.git","ssh_url":"git@github.com:csnover/scummvm.git","clone_url":"https://github.com/csnover/scummvm.git","svn_url":"https://github.com/csnover/scummvm","homepage":"http://www.scummvm.org/","size":220748,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"csnover:master","ref":"master","sha":"d2ae7fa3fa3920c6fe0a605ecedb67cd8a1f9f09","user":{"login":"csnover","id":229244,"avatar_url":"https://avatars.githubusercontent.com/u/229244?v=3","gravatar_id":"","url":"https://api.github.com/users/csnover","html_url":"https://github.com/csnover","followers_url":"https://api.github.com/users/csnover/followers","following_url":"https://api.github.com/users/csnover/following{/other_user}","gists_url":"https://api.github.com/users/csnover/gists{/gist_id}","starred_url":"https://api.github.com/users/csnover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnover/subscriptions","organizations_url":"https://api.github.com/users/csnover/orgs","repos_url":"https://api.github.com/users/csnover/repos","events_url":"https://api.github.com/users/csnover/events{/privacy}","received_events_url":"https://api.github.com/users/csnover/received_events","type":"User","site_admin":false},"repo":{"id":40680302,"name":"scummvm","full_name":"csnover/scummvm","owner":{"login":"csnover","id":229244,"avatar_url":"https://avatars.githubusercontent.com/u/229244?v=3","gravatar_id":"","url":"https://api.github.com/users/csnover","html_url":"https://github.com/csnover","followers_url":"https://api.github.com/users/csnover/followers","following_url":"https://api.github.com/users/csnover/following{/other_user}","gists_url":"https://api.github.com/users/csnover/gists{/gist_id}","starred_url":"https://api.github.com/users/csnover/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csnover/subscriptions","organizations_url":"https://api.github.com/users/csnover/orgs","repos_url":"https://api.github.com/users/csnover/repos","events_url":"https://api.github.com/users/csnover/events{/privacy}","received_events_url":"https://api.github.com/users/csnover/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csnover/scummvm","description":"ScummVM main repository","fork":true,"url":"https://api.github.com/repos/csnover/scummvm","forks_url":"https://api.github.com/repos/csnover/scummvm/forks","keys_url":"https://api.github.com/repos/csnover/scummvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csnover/scummvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csnover/scummvm/teams","hooks_url":"https://api.github.com/repos/csnover/scummvm/hooks","issue_events_url":"https://api.github.com/repos/csnover/scummvm/issues/events{/number}","events_url":"https://api.github.com/repos/csnover/scummvm/events","assignees_url":"https://api.github.com/repos/csnover/scummvm/assignees{/user}","branches_url":"https://api.github.com/repos/csnover/scummvm/branches{/branch}","tags_url":"https://api.github.com/repos/csnover/scummvm/tags","blobs_url":"https://api.github.com/repos/csnover/scummvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csnover/scummvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csnover/scummvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/csnover/scummvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csnover/scummvm/statuses/{sha}","languages_url":"https://api.github.com/repos/csnover/scummvm/languages","stargazers_url":"https://api.github.com/repos/csnover/scummvm/stargazers","contributors_url":"https://api.github.com/repos/csnover/scummvm/contributors","subscribers_url":"https://api.github.com/repos/csnover/scummvm/subscribers","subscription_url":"https://api.github.com/repos/csnover/scummvm/subscription","commits_url":"https://api.github.com/repos/csnover/scummvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/csnover/scummvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/csnover/scummvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/csnover/scummvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/csnover/scummvm/contents/{+path}","compare_url":"https://api.github.com/repos/csnover/scummvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csnover/scummvm/merges","archive_url":"https://api.github.com/repos/csnover/scummvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csnover/scummvm/downloads","issues_url":"https://api.github.com/repos/csnover/scummvm/issues{/number}","pulls_url":"https://api.github.com/repos/csnover/scummvm/pulls{/number}","milestones_url":"https://api.github.com/repos/csnover/scummvm/milestones{/number}","notifications_url":"https://api.github.com/repos/csnover/scummvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csnover/scummvm/labels{/name}","releases_url":"https://api.github.com/repos/csnover/scummvm/releases{/id}","deployments_url":"https://api.github.com/repos/csnover/scummvm/deployments","created_at":"2015-08-13T20:29:41Z","updated_at":"2016-02-16T22:52:47Z","pushed_at":"2016-12-07T15:38:31Z","git_url":"git://github.com/csnover/scummvm.git","ssh_url":"git@github.com:csnover/scummvm.git","clone_url":"https://github.com/csnover/scummvm.git","svn_url":"https://github.com/csnover/scummvm","homepage":"http://www.scummvm.org/","size":220748,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csnover/scummvm/pulls/4"},"html":{"href":"https://github.com/csnover/scummvm/pull/4"},"issue":{"href":"https://api.github.com/repos/csnover/scummvm/issues/4"},"comments":{"href":"https://api.github.com/repos/csnover/scummvm/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/csnover/scummvm/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/csnover/scummvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csnover/scummvm/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/csnover/scummvm/statuses/7b98b23ea82f5a6cdb6d5f5ed086bfe57617f643"}}}}
{"actor":{"display_login":"csnover"}}