Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert commit fc73e2e (PR 5005) for breaking certain PDF files #5069

Merged
merged 1 commit into from
Jul 22, 2014
Merged

Revert commit fc73e2e (PR 5005) for breaking certain PDF files #5069

merged 1 commit into from
Jul 22, 2014

Conversation

Snuffleupagus
Copy link
Collaborator

After fc73e2e (i.e. the second commit of PR #5005), the first page of http://arxiv.org/pdf/1112.0542v1.pdf no longer renders. This is only reproducible in the addon with range requests active.

/cc @fkaelberer

@Snuffleupagus
Copy link
Collaborator Author

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/393c69973ee6b35/output.txt

Snuffleupagus added a commit that referenced this pull request Jul 22, 2014
Revert commit fc73e2e (PR 5005) for breaking certain PDF files
@Snuffleupagus Snuffleupagus merged commit faa9020 into mozilla:master Jul 22, 2014
@Snuffleupagus Snuffleupagus deleted the revert-5005 branch July 22, 2014 19:33
@fkaelberer
Copy link
Contributor

My apologies for the bug. The bytesToString method is not the problem here.
Instead, calling ChunkedStream.getBytes(limit) has different effects than successive calls of ChunkedStream.getByte(), and I honestly don't understand why.

The bug does not appear when using

var charBuf = [];
for (var n = 0; n < limit; ++n) {
  charBuf.push(stream.getByte());
}
var str = bytesToString(charBuf);

instead of

var str = bytesToString(stream.getBytes(limit));

in core.js.

Should I reopen a PR with the above fixes, or is it still too risky? (In particular, the changes in stream.js)

@Snuffleupagus
Copy link
Collaborator Author

Should I reopen a PR with the above fixes, or is it still too risky?

Personally I think we should try to figure out why this failed in the first place, before attempting to make any more changes.

My apologies for the bug.

We caught it just before the latest uplift to mozilla-central, so no harm done here :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants