{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/5655","labels_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5655/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5655/comments","events_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5655/events","html_url":"https://github.com/mozilla/pdf.js/pull/5655","id":54660366,"number":5655,"title":"Avoid getting stuck in empty nodes in the Pages tree when calling |Catalog_getPageDict| (issue 5644)","user":{"login":"Snuffleupagus","id":2692120,"avatar_url":"https://avatars.githubusercontent.com/u/2692120?v=3","gravatar_id":"","url":"https://api.github.com/users/Snuffleupagus","html_url":"https://github.com/Snuffleupagus","followers_url":"https://api.github.com/users/Snuffleupagus/followers","following_url":"https://api.github.com/users/Snuffleupagus/following{/other_user}","gists_url":"https://api.github.com/users/Snuffleupagus/gists{/gist_id}","starred_url":"https://api.github.com/users/Snuffleupagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snuffleupagus/subscriptions","organizations_url":"https://api.github.com/users/Snuffleupagus/orgs","repos_url":"https://api.github.com/users/Snuffleupagus/repos","events_url":"https://api.github.com/users/Snuffleupagus/events{/privacy}","received_events_url":"https://api.github.com/users/Snuffleupagus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mozilla/pdf.js/labels/1-core","name":"1-core","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mozilla/pdf.js/milestones/16","labels_url":"https://api.github.com/repos/mozilla/pdf.js/milestones/16/labels","id":924055,"number":16,"title":"2015 Q1","description":"- B2G Viewer refactoring\r\n- Regressions","creator":{"login":"yurydelendik","id":1523410,"avatar_url":"https://avatars.githubusercontent.com/u/1523410?v=3","gravatar_id":"","url":"https://api.github.com/users/yurydelendik","html_url":"https://github.com/yurydelendik","followers_url":"https://api.github.com/users/yurydelendik/followers","following_url":"https://api.github.com/users/yurydelendik/following{/other_user}","gists_url":"https://api.github.com/users/yurydelendik/gists{/gist_id}","starred_url":"https://api.github.com/users/yurydelendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurydelendik/subscriptions","organizations_url":"https://api.github.com/users/yurydelendik/orgs","repos_url":"https://api.github.com/users/yurydelendik/repos","events_url":"https://api.github.com/users/yurydelendik/events{/privacy}","received_events_url":"https://api.github.com/users/yurydelendik/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":2,"state":"open","created_at":"2015-01-06T16:46:42Z","updated_at":"2015-01-22T19:29:22Z","due_on":"2015-03-30T22:00:00Z","closed_at":null},"comments":6,"created_at":"2015-01-17T12:26:40Z","updated_at":"2015-01-23T20:43:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mozilla/pdf.js/pulls/5655","html_url":"https://github.com/mozilla/pdf.js/pull/5655","diff_url":"https://github.com/mozilla/pdf.js/pull/5655.diff","patch_url":"https://github.com/mozilla/pdf.js/pull/5655.patch"},"body":"This is a tentative patch that fixes #5644.\r\n\r\nThe issue with the referenced PDF file is that the `Pages` dictionary contains a number of empty `Kids`, and we were getting stuck in those nodes before reaching the actual pages.\r\nAs far as I can tell [this code is just an optimization](https://github.com/mozilla/pdf.js/blob/master/src/core/obj.js#L636), to avoid what is usually a number of unnecessary iterations, but isn't strictly necessary. The only way I could find to solve the particular issue referenced, and to avoid similar issues in the future, was to remove that code path. This might mean that the lookup becomes a *tiny* bit slower in very large files, but I unfortunately found no other way to fix the issue (hence why I'm labelling this as a tentative patch).\r\n\r\n*Note:* I'm adding an `eq` test since, when attempting to fix the issue without removing the optimization, at one point the code would cause the *first* page to render on *all* pages."},"comment":{"url":"https://api.github.com/repos/mozilla/pdf.js/issues/comments/71262364","html_url":"https://github.com/mozilla/pdf.js/pull/5655#issuecomment-71262364","issue_url":"https://api.github.com/repos/mozilla/pdf.js/issues/5655","id":71262364,"user":{"login":"Snuffleupagus","id":2692120,"avatar_url":"https://avatars.githubusercontent.com/u/2692120?v=3","gravatar_id":"","url":"https://api.github.com/users/Snuffleupagus","html_url":"https://github.com/Snuffleupagus","followers_url":"https://api.github.com/users/Snuffleupagus/followers","following_url":"https://api.github.com/users/Snuffleupagus/following{/other_user}","gists_url":"https://api.github.com/users/Snuffleupagus/gists{/gist_id}","starred_url":"https://api.github.com/users/Snuffleupagus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Snuffleupagus/subscriptions","organizations_url":"https://api.github.com/users/Snuffleupagus/orgs","repos_url":"https://api.github.com/users/Snuffleupagus/repos","events_url":"https://api.github.com/users/Snuffleupagus/events{/privacy}","received_events_url":"https://api.github.com/users/Snuffleupagus/received_events","type":"User","site_admin":false},"created_at":"2015-01-23T20:43:52Z","updated_at":"2015-01-23T20:43:52Z","body":"/botio-windows preview"}}