Skip to content

Commit

Permalink
Fix issue mozilla#5026
Browse files Browse the repository at this point in the history
  • Loading branch information
fkaelberer committed Jul 31, 2014
1 parent aaae640 commit 358b2c4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/jbig2.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
];

var ReusedContexts = [
0x1CD3, // '00111001101' (template) + '0011' (at),
0x3953, // '001110010101' (template) + '0011' (at),
0x079A, // '001111001101' + '0',
0x00E3, // '001110001' + '1',
0x018B // '011000101' + '1'
Expand All @@ -165,9 +165,11 @@ var Jbig2Image = (function Jbig2ImageClosure() {
// Sorting is non-standard, and it is not required. But sorting increases
// the number of template bits that can be reused from the previous
// contextLabel in the main loop.
template.sort(function (a, b) {
return (a.y - b.y) || (a.x - b.x);
});
if (!prediction) {
template.sort(function (a, b) {
return (a.y - b.y) || (a.x - b.x);
});
}

var templateLength = template.length;
var templateX = new Int8Array(templateLength);
Expand Down

0 comments on commit 358b2c4

Please sign in to comment.