]> git.parisson.com Git - pdf.js.git/commitdiff
Style fixes
authorfixplz <gust.tgm@gmail.com>
Sun, 4 Dec 2011 22:00:22 +0000 (00:00 +0200)
committerfixplz <gust.tgm@gmail.com>
Sun, 4 Dec 2011 22:00:22 +0000 (00:00 +0200)
src/core.js

index 3c09819547f9f0cd4ae538e0b18a1ba6998888ae..32c13d8cf2f46e6d4417dd968945cc8755546222 100644 (file)
@@ -381,14 +381,15 @@ var PDFDocModel = (function pdfDoc() {
         if (find(stream, 'endobj', 1024))
           startXRef = stream.pos + 6;
       } else {
-        // Find startxref at the end of the file.
+        // Find startxref by jumping backward from the end of the file.
+        var step = 1024;
         var found = false, pos = stream.end;
-        while(!found && pos > 0) {
-          pos -= 1024 - 9;
+        while (!found && pos > 0) {
+          pos -= step - 'startxref'.length;
           if (pos < 0)
             pos = 0;
           stream.pos = pos;
-          found = find(stream, 'startxref', 1024, true);
+          found = find(stream, 'startxref', step, true);
         }
         if (found) {
           stream.skip(9);