{"action":"created","comment":{"url":"https://api.github.com/repos/servo/servo/pulls/comments/52764774","id":52764774,"diff_hunk":"@@ -37,6 +37,22 @@ fn test_sniff_mp4_matcher() {\n     }\n }\n \n+#[test]\n+fn test_sniff_mp4_matcher_long() {\n+    // Check that a multi-byte length is calculated correctly\n+    let matcher = Mp4Matcher;\n+\n+    let mut data: [u8; 260] = [0; 260];\n+    &data[.. 11].clone_from_slice(\n+        &[0x00, 0x00, 0x01, 0x04, 0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34]\n+    );\n+\n+    println!(\"Data Length {:?}\", data.len());\n+    if !matcher.matches(&data) {","path":"tests/unit/net/mime_classifier.rs","position":15,"original_position":15,"commit_id":"4819d9ab878ebb4674976d62346e0724faa5b9ea","original_commit_id":"4819d9ab878ebb4674976d62346e0724faa5b9ea","user":{"login":"jdm","id":27658,"avatar_url":"https://avatars.githubusercontent.com/u/27658?v=3","gravatar_id":"","url":"https://api.github.com/users/jdm","html_url":"https://github.com/jdm","followers_url":"https://api.github.com/users/jdm/followers","following_url":"https://api.github.com/users/jdm/following{/other_user}","gists_url":"https://api.github.com/users/jdm/gists{/gist_id}","starred_url":"https://api.github.com/users/jdm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdm/subscriptions","organizations_url":"https://api.github.com/users/jdm/orgs","repos_url":"https://api.github.com/users/jdm/repos","events_url":"https://api.github.com/users/jdm/events{/privacy}","received_events_url":"https://api.github.com/users/jdm/received_events","type":"User","site_admin":false},"body":"`assert!(matcher.matches(&data));`","created_at":"2016-02-12T16:39:51Z","updated_at":"2016-02-12T16:39:51Z","html_url":"https://github.com/servo/servo/pull/9618#discussion_r52764774","pull_request_url":"https://api.github.com/repos/servo/servo/pulls/9618","_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/comments/52764774"},"html":{"href":"https://github.com/servo/servo/pull/9618#discussion_r52764774"},"pull_request":{"href":"https://api.github.com/repos/servo/servo/pulls/9618"}}},"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/9618","id":59196831,"html_url":"https://github.com/servo/servo/pull/9618","diff_url":"https://github.com/servo/servo/pull/9618.diff","patch_url":"https://github.com/servo/servo/pull/9618.patch","issue_url":"https://api.github.com/repos/servo/servo/issues/9618","number":9618,"state":"open","locked":false,"title":"Calculate correct mp4 header length.","user":{"login":"jongiddy","id":3735327,"avatar_url":"https://avatars.githubusercontent.com/u/3735327?v=3","gravatar_id":"","url":"https://api.github.com/users/jongiddy","html_url":"https://github.com/jongiddy","followers_url":"https://api.github.com/users/jongiddy/followers","following_url":"https://api.github.com/users/jongiddy/following{/other_user}","gists_url":"https://api.github.com/users/jongiddy/gists{/gist_id}","starred_url":"https://api.github.com/users/jongiddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jongiddy/subscriptions","organizations_url":"https://api.github.com/users/jongiddy/orgs","repos_url":"https://api.github.com/users/jongiddy/repos","events_url":"https://api.github.com/users/jongiddy/events{/privacy}","received_events_url":"https://api.github.com/users/jongiddy/received_events","type":"User","site_admin":false},"body":"The calculation of MP4 frame length is incorrect, shifting values by 1 bit instead of 8 bits.  It works for the test MP4 file because the length of the frame is less than 256 bytes, so the shifted values are all zero.\r\n\r\nThis PR changes the code to calculate the length correctly. It adds a test to check a fake long stream. Still not long enough to test completely, but at least detects the problem with the original code.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.svg\" height=\"40\" alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/9618)\n<!-- Reviewable:end -->\n","created_at":"2016-02-12T16:35:04Z","updated_at":"2016-02-12T16:39:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9bb7929c29f8b121c6d0847c97b9ded093168438","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/servo/servo/pulls/9618/commits","review_comments_url":"https://api.github.com/repos/servo/servo/pulls/9618/comments","review_comment_url":"https://api.github.com/repos/servo/servo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/servo/servo/issues/9618/comments","statuses_url":"https://api.github.com/repos/servo/servo/statuses/4819d9ab878ebb4674976d62346e0724faa5b9ea","head":{"label":"jongiddy:fix-mp4-size","ref":"fix-mp4-size","sha":"4819d9ab878ebb4674976d62346e0724faa5b9ea","user":{"login":"jongiddy","id":3735327,"avatar_url":"https://avatars.githubusercontent.com/u/3735327?v=3","gravatar_id":"","url":"https://api.github.com/users/jongiddy","html_url":"https://github.com/jongiddy","followers_url":"https://api.github.com/users/jongiddy/followers","following_url":"https://api.github.com/users/jongiddy/following{/other_user}","gists_url":"https://api.github.com/users/jongiddy/gists{/gist_id}","starred_url":"https://api.github.com/users/jongiddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jongiddy/subscriptions","organizations_url":"https://api.github.com/users/jongiddy/orgs","repos_url":"https://api.github.com/users/jongiddy/repos","events_url":"https://api.github.com/users/jongiddy/events{/privacy}","received_events_url":"https://api.github.com/users/jongiddy/received_events","type":"User","site_admin":false},"repo":{"id":51580985,"name":"servo","full_name":"jongiddy/servo","owner":{"login":"jongiddy","id":3735327,"avatar_url":"https://avatars.githubusercontent.com/u/3735327?v=3","gravatar_id":"","url":"https://api.github.com/users/jongiddy","html_url":"https://github.com/jongiddy","followers_url":"https://api.github.com/users/jongiddy/followers","following_url":"https://api.github.com/users/jongiddy/following{/other_user}","gists_url":"https://api.github.com/users/jongiddy/gists{/gist_id}","starred_url":"https://api.github.com/users/jongiddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jongiddy/subscriptions","organizations_url":"https://api.github.com/users/jongiddy/orgs","repos_url":"https://api.github.com/users/jongiddy/repos","events_url":"https://api.github.com/users/jongiddy/events{/privacy}","received_events_url":"https://api.github.com/users/jongiddy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jongiddy/servo","description":"The Servo Browser Engine","fork":true,"url":"https://api.github.com/repos/jongiddy/servo","forks_url":"https://api.github.com/repos/jongiddy/servo/forks","keys_url":"https://api.github.com/repos/jongiddy/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jongiddy/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jongiddy/servo/teams","hooks_url":"https://api.github.com/repos/jongiddy/servo/hooks","issue_events_url":"https://api.github.com/repos/jongiddy/servo/issues/events{/number}","events_url":"https://api.github.com/repos/jongiddy/servo/events","assignees_url":"https://api.github.com/repos/jongiddy/servo/assignees{/user}","branches_url":"https://api.github.com/repos/jongiddy/servo/branches{/branch}","tags_url":"https://api.github.com/repos/jongiddy/servo/tags","blobs_url":"https://api.github.com/repos/jongiddy/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jongiddy/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jongiddy/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/jongiddy/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jongiddy/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/jongiddy/servo/languages","stargazers_url":"https://api.github.com/repos/jongiddy/servo/stargazers","contributors_url":"https://api.github.com/repos/jongiddy/servo/contributors","subscribers_url":"https://api.github.com/repos/jongiddy/servo/subscribers","subscription_url":"https://api.github.com/repos/jongiddy/servo/subscription","commits_url":"https://api.github.com/repos/jongiddy/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/jongiddy/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/jongiddy/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/jongiddy/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/jongiddy/servo/contents/{+path}","compare_url":"https://api.github.com/repos/jongiddy/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jongiddy/servo/merges","archive_url":"https://api.github.com/repos/jongiddy/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jongiddy/servo/downloads","issues_url":"https://api.github.com/repos/jongiddy/servo/issues{/number}","pulls_url":"https://api.github.com/repos/jongiddy/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/jongiddy/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/jongiddy/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jongiddy/servo/labels{/name}","releases_url":"https://api.github.com/repos/jongiddy/servo/releases{/id}","deployments_url":"https://api.github.com/repos/jongiddy/servo/deployments","created_at":"2016-02-12T10:32:32Z","updated_at":"2016-02-12T05:16:38Z","pushed_at":"2016-02-12T16:33:47Z","git_url":"git://github.com/jongiddy/servo.git","ssh_url":"git@github.com:jongiddy/servo.git","clone_url":"https://github.com/jongiddy/servo.git","svn_url":"https://github.com/jongiddy/servo","homepage":"https://servo.org/","size":170183,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"servo:master","ref":"master","sha":"ee11a847dd4a5c3e3a618fc588773ae8f1624e27","user":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"repo":{"id":3390243,"name":"servo","full_name":"servo/servo","owner":{"login":"servo","id":2566135,"avatar_url":"https://avatars.githubusercontent.com/u/2566135?v=3","gravatar_id":"","url":"https://api.github.com/users/servo","html_url":"https://github.com/servo","followers_url":"https://api.github.com/users/servo/followers","following_url":"https://api.github.com/users/servo/following{/other_user}","gists_url":"https://api.github.com/users/servo/gists{/gist_id}","starred_url":"https://api.github.com/users/servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/servo/subscriptions","organizations_url":"https://api.github.com/users/servo/orgs","repos_url":"https://api.github.com/users/servo/repos","events_url":"https://api.github.com/users/servo/events{/privacy}","received_events_url":"https://api.github.com/users/servo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/servo/servo","description":"The Servo Browser Engine","fork":false,"url":"https://api.github.com/repos/servo/servo","forks_url":"https://api.github.com/repos/servo/servo/forks","keys_url":"https://api.github.com/repos/servo/servo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/servo/servo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/servo/servo/teams","hooks_url":"https://api.github.com/repos/servo/servo/hooks","issue_events_url":"https://api.github.com/repos/servo/servo/issues/events{/number}","events_url":"https://api.github.com/repos/servo/servo/events","assignees_url":"https://api.github.com/repos/servo/servo/assignees{/user}","branches_url":"https://api.github.com/repos/servo/servo/branches{/branch}","tags_url":"https://api.github.com/repos/servo/servo/tags","blobs_url":"https://api.github.com/repos/servo/servo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/servo/servo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/servo/servo/git/refs{/sha}","trees_url":"https://api.github.com/repos/servo/servo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/servo/servo/statuses/{sha}","languages_url":"https://api.github.com/repos/servo/servo/languages","stargazers_url":"https://api.github.com/repos/servo/servo/stargazers","contributors_url":"https://api.github.com/repos/servo/servo/contributors","subscribers_url":"https://api.github.com/repos/servo/servo/subscribers","subscription_url":"https://api.github.com/repos/servo/servo/subscription","commits_url":"https://api.github.com/repos/servo/servo/commits{/sha}","git_commits_url":"https://api.github.com/repos/servo/servo/git/commits{/sha}","comments_url":"https://api.github.com/repos/servo/servo/comments{/number}","issue_comment_url":"https://api.github.com/repos/servo/servo/issues/comments{/number}","contents_url":"https://api.github.com/repos/servo/servo/contents/{+path}","compare_url":"https://api.github.com/repos/servo/servo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/servo/servo/merges","archive_url":"https://api.github.com/repos/servo/servo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/servo/servo/downloads","issues_url":"https://api.github.com/repos/servo/servo/issues{/number}","pulls_url":"https://api.github.com/repos/servo/servo/pulls{/number}","milestones_url":"https://api.github.com/repos/servo/servo/milestones{/number}","notifications_url":"https://api.github.com/repos/servo/servo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/servo/servo/labels{/name}","releases_url":"https://api.github.com/repos/servo/servo/releases{/id}","deployments_url":"https://api.github.com/repos/servo/servo/deployments","created_at":"2012-02-08T19:07:25Z","updated_at":"2016-02-12T15:27:39Z","pushed_at":"2016-02-12T16:35:30Z","git_url":"git://github.com/servo/servo.git","ssh_url":"git@github.com:servo/servo.git","clone_url":"https://github.com/servo/servo.git","svn_url":"https://github.com/servo/servo","homepage":"https://servo.org/","size":201644,"stargazers_count":5626,"watchers_count":5626,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":959,"mirror_url":null,"open_issues_count":1290,"forks":959,"open_issues":1290,"watchers":5626,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/servo/servo/pulls/9618"},"html":{"href":"https://github.com/servo/servo/pull/9618"},"issue":{"href":"https://api.github.com/repos/servo/servo/issues/9618"},"comments":{"href":"https://api.github.com/repos/servo/servo/issues/9618/comments"},"review_comments":{"href":"https://api.github.com/repos/servo/servo/pulls/9618/comments"},"review_comment":{"href":"https://api.github.com/repos/servo/servo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/servo/servo/pulls/9618/commits"},"statuses":{"href":"https://api.github.com/repos/servo/servo/statuses/4819d9ab878ebb4674976d62346e0724faa5b9ea"}}}}