{"action":"created","comment":{"url":"https://api.github.com/repos/mono/libgdiplus/pulls/comments/170586891","pull_request_review_id":99293751,"id":170586891,"diff_hunk":"@@ -1068,13 +1140,19 @@ gdip_read_bmp_image (void *pointer, GpImage **image, ImageSource source)\n \tresult->active_bitmap->scan0 = pixels;\n \tresult->active_bitmap->reserved = GBD_OWN_SCAN0;\n \tresult->active_bitmap->image_flags = ImageFlagsReadOnly | ImageFlagsHasRealPixelSize | ImageFlagsColorSpaceRGB;\n-\tif (bmi.biXPelsPerMeter != 0 && bmi.biYPelsPerMeter != 0)\n+\tif (bmi->biXPelsPerMeter != 0 && bmi->biYPelsPerMeter != 0)\n \t\tresult->active_bitmap->image_flags |= ImageFlagsHasRealDPI;\n \n+\tGdipFree (bmi);\n+\n \t*image = result;\n \treturn Ok;\n \n error:\n+\tif (bmi != NULL) {","path":"src/bmpcodec.c","position":328,"original_position":328,"commit_id":"3838b657c0286ffe6a04a2b4a60c38e3ef10d2bf","original_commit_id":"3838b657c0286ffe6a04a2b4a60c38e3ef10d2bf","user":{"login":"filipnavara","id":1764393,"avatar_url":"https://avatars3.githubusercontent.com/u/1764393?v=4","gravatar_id":"","url":"https://api.github.com/users/filipnavara","html_url":"https://github.com/filipnavara","followers_url":"https://api.github.com/users/filipnavara/followers","following_url":"https://api.github.com/users/filipnavara/following{/other_user}","gists_url":"https://api.github.com/users/filipnavara/gists{/gist_id}","starred_url":"https://api.github.com/users/filipnavara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filipnavara/subscriptions","organizations_url":"https://api.github.com/users/filipnavara/orgs","repos_url":"https://api.github.com/users/filipnavara/repos","events_url":"https://api.github.com/users/filipnavara/events{/privacy}","received_events_url":"https://api.github.com/users/filipnavara/received_events","type":"User","site_admin":false},"body":"Fair enough, I missed that. I am not a big fan of functions that return failure and require additional cleanup. It would seem cleaner to me if the cleanup was done directly in gdip_read_BITMAPINFOHEADER.","created_at":"2018-02-26T13:17:05Z","updated_at":"2018-02-26T13:17:05Z","html_url":"https://github.com/mono/libgdiplus/pull/186#discussion_r170586891","pull_request_url":"https://api.github.com/repos/mono/libgdiplus/pulls/186","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/mono/libgdiplus/pulls/comments/170586891"},"html":{"href":"https://github.com/mono/libgdiplus/pull/186#discussion_r170586891"},"pull_request":{"href":"https://api.github.com/repos/mono/libgdiplus/pulls/186"}},"in_reply_to_id":170584822},"pull_request":{"url":"https://api.github.com/repos/mono/libgdiplus/pulls/186","id":158781377,"html_url":"https://github.com/mono/libgdiplus/pull/186","diff_url":"https://github.com/mono/libgdiplus/pull/186.diff","patch_url":"https://github.com/mono/libgdiplus/pull/186.patch","issue_url":"https://api.github.com/repos/mono/libgdiplus/issues/186","number":186,"state":"open","locked":false,"title":"Support later versions of BITMAPINFOHEADER and fix 16bpp decoding","user":{"login":"hughbe","id":1275900,"avatar_url":"https://avatars0.githubusercontent.com/u/1275900?v=4","gravatar_id":"","url":"https://api.github.com/users/hughbe","html_url":"https://github.com/hughbe","followers_url":"https://api.github.com/users/hughbe/followers","following_url":"https://api.github.com/users/hughbe/following{/other_user}","gists_url":"https://api.github.com/users/hughbe/gists{/gist_id}","starred_url":"https://api.github.com/users/hughbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughbe/subscriptions","organizations_url":"https://api.github.com/users/hughbe/orgs","repos_url":"https://api.github.com/users/hughbe/repos","events_url":"https://api.github.com/users/hughbe/events{/privacy}","received_events_url":"https://api.github.com/users/hughbe/received_events","type":"User","site_admin":false},"body":"And disallow unknown sizes of headers to match GDI+ behaviour\r\n\r\nPreviously, we would read only 40 bytes worth of the header at all times, whatever the biSize field of the header said.\r\n\r\nThis means that we'd interpret bytes from BITMAPV3/V4/V5HEADER as palette or image data\r\n\r\nFor 16bpp we would cause a heap buffer overflow/crash and this fixes that bub too\r\n\r\nFixes #187 \r\nFixes #188","created_at":"2017-12-17T11:18:57Z","updated_at":"2018-02-26T13:17:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ef3cca20631bd0a618dff202445ef346ff4f8cc0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mono/libgdiplus/pulls/186/commits","review_comments_url":"https://api.github.com/repos/mono/libgdiplus/pulls/186/comments","review_comment_url":"https://api.github.com/repos/mono/libgdiplus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mono/libgdiplus/issues/186/comments","statuses_url":"https://api.github.com/repos/mono/libgdiplus/statuses/3838b657c0286ffe6a04a2b4a60c38e3ef10d2bf","head":{"label":"hughbe:bmpcodec-later-versions","ref":"bmpcodec-later-versions","sha":"3838b657c0286ffe6a04a2b4a60c38e3ef10d2bf","user":{"login":"hughbe","id":1275900,"avatar_url":"https://avatars0.githubusercontent.com/u/1275900?v=4","gravatar_id":"","url":"https://api.github.com/users/hughbe","html_url":"https://github.com/hughbe","followers_url":"https://api.github.com/users/hughbe/followers","following_url":"https://api.github.com/users/hughbe/following{/other_user}","gists_url":"https://api.github.com/users/hughbe/gists{/gist_id}","starred_url":"https://api.github.com/users/hughbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughbe/subscriptions","organizations_url":"https://api.github.com/users/hughbe/orgs","repos_url":"https://api.github.com/users/hughbe/repos","events_url":"https://api.github.com/users/hughbe/events{/privacy}","received_events_url":"https://api.github.com/users/hughbe/received_events","type":"User","site_admin":false},"repo":{"id":95409644,"name":"libgdiplus","full_name":"hughbe/libgdiplus","owner":{"login":"hughbe","id":1275900,"avatar_url":"https://avatars0.githubusercontent.com/u/1275900?v=4","gravatar_id":"","url":"https://api.github.com/users/hughbe","html_url":"https://github.com/hughbe","followers_url":"https://api.github.com/users/hughbe/followers","following_url":"https://api.github.com/users/hughbe/following{/other_user}","gists_url":"https://api.github.com/users/hughbe/gists{/gist_id}","starred_url":"https://api.github.com/users/hughbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughbe/subscriptions","organizations_url":"https://api.github.com/users/hughbe/orgs","repos_url":"https://api.github.com/users/hughbe/repos","events_url":"https://api.github.com/users/hughbe/events{/privacy}","received_events_url":"https://api.github.com/users/hughbe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hughbe/libgdiplus","description":"C-based implementation of the GDI+ API","fork":true,"url":"https://api.github.com/repos/hughbe/libgdiplus","forks_url":"https://api.github.com/repos/hughbe/libgdiplus/forks","keys_url":"https://api.github.com/repos/hughbe/libgdiplus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hughbe/libgdiplus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hughbe/libgdiplus/teams","hooks_url":"https://api.github.com/repos/hughbe/libgdiplus/hooks","issue_events_url":"https://api.github.com/repos/hughbe/libgdiplus/issues/events{/number}","events_url":"https://api.github.com/repos/hughbe/libgdiplus/events","assignees_url":"https://api.github.com/repos/hughbe/libgdiplus/assignees{/user}","branches_url":"https://api.github.com/repos/hughbe/libgdiplus/branches{/branch}","tags_url":"https://api.github.com/repos/hughbe/libgdiplus/tags","blobs_url":"https://api.github.com/repos/hughbe/libgdiplus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hughbe/libgdiplus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hughbe/libgdiplus/git/refs{/sha}","trees_url":"https://api.github.com/repos/hughbe/libgdiplus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hughbe/libgdiplus/statuses/{sha}","languages_url":"https://api.github.com/repos/hughbe/libgdiplus/languages","stargazers_url":"https://api.github.com/repos/hughbe/libgdiplus/stargazers","contributors_url":"https://api.github.com/repos/hughbe/libgdiplus/contributors","subscribers_url":"https://api.github.com/repos/hughbe/libgdiplus/subscribers","subscription_url":"https://api.github.com/repos/hughbe/libgdiplus/subscription","commits_url":"https://api.github.com/repos/hughbe/libgdiplus/commits{/sha}","git_commits_url":"https://api.github.com/repos/hughbe/libgdiplus/git/commits{/sha}","comments_url":"https://api.github.com/repos/hughbe/libgdiplus/comments{/number}","issue_comment_url":"https://api.github.com/repos/hughbe/libgdiplus/issues/comments{/number}","contents_url":"https://api.github.com/repos/hughbe/libgdiplus/contents/{+path}","compare_url":"https://api.github.com/repos/hughbe/libgdiplus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hughbe/libgdiplus/merges","archive_url":"https://api.github.com/repos/hughbe/libgdiplus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hughbe/libgdiplus/downloads","issues_url":"https://api.github.com/repos/hughbe/libgdiplus/issues{/number}","pulls_url":"https://api.github.com/repos/hughbe/libgdiplus/pulls{/number}","milestones_url":"https://api.github.com/repos/hughbe/libgdiplus/milestones{/number}","notifications_url":"https://api.github.com/repos/hughbe/libgdiplus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hughbe/libgdiplus/labels{/name}","releases_url":"https://api.github.com/repos/hughbe/libgdiplus/releases{/id}","deployments_url":"https://api.github.com/repos/hughbe/libgdiplus/deployments","created_at":"2017-06-26T04:53:00Z","updated_at":"2017-06-26T04:53:02Z","pushed_at":"2018-02-25T17:39:31Z","git_url":"git://github.com/hughbe/libgdiplus.git","ssh_url":"git@github.com:hughbe/libgdiplus.git","clone_url":"https://github.com/hughbe/libgdiplus.git","svn_url":"https://github.com/hughbe/libgdiplus","homepage":"http://www.mono-project.com/","size":13572,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mono:master","ref":"master","sha":"7e5300bf7edab4e8107cfeeb95629d0488718ff6","user":{"login":"mono","id":53395,"avatar_url":"https://avatars3.githubusercontent.com/u/53395?v=4","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"repo":{"id":791260,"name":"libgdiplus","full_name":"mono/libgdiplus","owner":{"login":"mono","id":53395,"avatar_url":"https://avatars3.githubusercontent.com/u/53395?v=4","gravatar_id":"","url":"https://api.github.com/users/mono","html_url":"https://github.com/mono","followers_url":"https://api.github.com/users/mono/followers","following_url":"https://api.github.com/users/mono/following{/other_user}","gists_url":"https://api.github.com/users/mono/gists{/gist_id}","starred_url":"https://api.github.com/users/mono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mono/subscriptions","organizations_url":"https://api.github.com/users/mono/orgs","repos_url":"https://api.github.com/users/mono/repos","events_url":"https://api.github.com/users/mono/events{/privacy}","received_events_url":"https://api.github.com/users/mono/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mono/libgdiplus","description":"C-based implementation of the GDI+ API","fork":false,"url":"https://api.github.com/repos/mono/libgdiplus","forks_url":"https://api.github.com/repos/mono/libgdiplus/forks","keys_url":"https://api.github.com/repos/mono/libgdiplus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mono/libgdiplus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mono/libgdiplus/teams","hooks_url":"https://api.github.com/repos/mono/libgdiplus/hooks","issue_events_url":"https://api.github.com/repos/mono/libgdiplus/issues/events{/number}","events_url":"https://api.github.com/repos/mono/libgdiplus/events","assignees_url":"https://api.github.com/repos/mono/libgdiplus/assignees{/user}","branches_url":"https://api.github.com/repos/mono/libgdiplus/branches{/branch}","tags_url":"https://api.github.com/repos/mono/libgdiplus/tags","blobs_url":"https://api.github.com/repos/mono/libgdiplus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mono/libgdiplus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mono/libgdiplus/git/refs{/sha}","trees_url":"https://api.github.com/repos/mono/libgdiplus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mono/libgdiplus/statuses/{sha}","languages_url":"https://api.github.com/repos/mono/libgdiplus/languages","stargazers_url":"https://api.github.com/repos/mono/libgdiplus/stargazers","contributors_url":"https://api.github.com/repos/mono/libgdiplus/contributors","subscribers_url":"https://api.github.com/repos/mono/libgdiplus/subscribers","subscription_url":"https://api.github.com/repos/mono/libgdiplus/subscription","commits_url":"https://api.github.com/repos/mono/libgdiplus/commits{/sha}","git_commits_url":"https://api.github.com/repos/mono/libgdiplus/git/commits{/sha}","comments_url":"https://api.github.com/repos/mono/libgdiplus/comments{/number}","issue_comment_url":"https://api.github.com/repos/mono/libgdiplus/issues/comments{/number}","contents_url":"https://api.github.com/repos/mono/libgdiplus/contents/{+path}","compare_url":"https://api.github.com/repos/mono/libgdiplus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mono/libgdiplus/merges","archive_url":"https://api.github.com/repos/mono/libgdiplus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mono/libgdiplus/downloads","issues_url":"https://api.github.com/repos/mono/libgdiplus/issues{/number}","pulls_url":"https://api.github.com/repos/mono/libgdiplus/pulls{/number}","milestones_url":"https://api.github.com/repos/mono/libgdiplus/milestones{/number}","notifications_url":"https://api.github.com/repos/mono/libgdiplus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mono/libgdiplus/labels{/name}","releases_url":"https://api.github.com/repos/mono/libgdiplus/releases{/id}","deployments_url":"https://api.github.com/repos/mono/libgdiplus/deployments","created_at":"2010-07-22T15:56:20Z","updated_at":"2018-02-26T10:15:56Z","pushed_at":"2018-02-25T11:59:17Z","git_url":"git://github.com/mono/libgdiplus.git","ssh_url":"git@github.com:mono/libgdiplus.git","clone_url":"https://github.com/mono/libgdiplus.git","svn_url":"https://github.com/mono/libgdiplus","homepage":"http://www.mono-project.com/","size":13971,"stargazers_count":102,"watchers_count":102,"language":"C","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":80,"mirror_url":null,"archived":false,"open_issues_count":69,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":80,"open_issues":69,"watchers":102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mono/libgdiplus/pulls/186"},"html":{"href":"https://github.com/mono/libgdiplus/pull/186"},"issue":{"href":"https://api.github.com/repos/mono/libgdiplus/issues/186"},"comments":{"href":"https://api.github.com/repos/mono/libgdiplus/issues/186/comments"},"review_comments":{"href":"https://api.github.com/repos/mono/libgdiplus/pulls/186/comments"},"review_comment":{"href":"https://api.github.com/repos/mono/libgdiplus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mono/libgdiplus/pulls/186/commits"},"statuses":{"href":"https://api.github.com/repos/mono/libgdiplus/statuses/3838b657c0286ffe6a04a2b4a60c38e3ef10d2bf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"filipnavara"}}