Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixes bad inflate block regression at 7df5f47f6c42d #1177

Merged
merged 1 commit into from

2 participants

@yurydelendik
Owner

No description provided.

@yurydelendik
Owner

/botio reftest

@shumwaybot

From: Bot.io (Main)


Received

Command cmd_reftest from @yurydelendik received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/43a876ff974d15b/output.txt

@shumwaybot

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/43a876ff974d15b/output.txt

Total script time: 4.77 mins

  • Lint: Passed

  • Reference tests: FAILED

TEST-UNEXPECTED-FAIL | stas flash_filters_BlurFilter trace | in firefox | trace of 1 != reference trace
TEST-UNEXPECTED-FAIL | stas flash_ui_ContextMenu trace | in chrome-ish | trace of 1 != reference trace
TEST-UNEXPECTED-FAIL | stas timeline_scene | in chrome-ish | trace of 4 != reference trace
TEST-UNEXPECTED-FAIL | stas timeline_scene | in chrome-ish | trace of 6 != reference trace
TEST-UNEXPECTED-FAIL | stas timeline_scene | in firefox | trace of 4 != reference trace

@yurydelendik
Owner

/botio reftest

@shumwaybot

From: Bot.io (Main)


Received

Command cmd_reftest from @yurydelendik received. Current queue size: 0

Live output at: http://areweflashyet.com:8081/f08a663971edecd/output.txt

@shumwaybot

From: Bot.io (Main)


Failed

Full output at http://areweflashyet.com:8081/f08a663971edecd/output.txt

Total script time: 4.70 mins

  • Lint: Passed

  • Reference tests: FAILED

TEST-UNEXPECTED-FAIL | stas button | in chrome-ish | trace of 1 != reference trace
TEST-UNEXPECTED-FAIL | stas timeline | in chrome-ish | trace of 2 != reference trace
TEST-UNEXPECTED-FAIL | stas flash_display_DisplayObject trace | in chrome-ish | trace of 1 != reference trace
TEST-UNEXPECTED-FAIL | stas 3_joystick | in chrome-ish | trace of 1 != reference trace
TEST-UNEXPECTED-FAIL | stas timeline_scene | in chrome-ish | trace of 1 != reference trace
TEST-UNEXPECTED-FAIL | stas timeline_scene | in firefox | trace of 6 != reference trace

@yurydelendik yurydelendik merged commit aa22c1e into from
@yurydelendik yurydelendik deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 7, 2014
  1. @yurydelendik
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 7 deletions.
  1. +11 −6 src/swf/inflate.js
  2. +3 −1 src/swf/parser.js
View
17 src/swf/inflate.js
@@ -77,7 +77,8 @@ function createInflatedStream(bytes, outputLength) {
available: 0,
completed: false
};
- var state = {};
+ var state = { header: null, distanceTable: null, literalTable: null,
+ sym: null, len: null, sym2: null };
do {
inflateBlock(stream, output, state);
} while (!output.completed && stream.pos < stream.end);
@@ -87,7 +88,8 @@ function createInflatedStream(bytes, outputLength) {
var InflateNoDataError = {};
function inflateBlock(stream, output, state) {
- var header = state.header || (state.header = readBits(stream.bytes, stream, 3));
+ var header = state.header !== null ? state.header :
+ (state.header = readBits(stream.bytes, stream, 3));
switch (header >> 1) {
case 0:
stream.align();
@@ -112,7 +114,7 @@ function inflateBlock(stream, output, state) {
break;
case 2:
var distanceTable, literalTable;
- if (state.distanceTable) {
+ if (state.distanceTable !== null) {
distanceTable = state.distanceTable;
literalTable = state.literalTable;
} else {
@@ -200,15 +202,18 @@ function inflate(stream, output, literalTable, distanceTable, state) {
var pos = output.available;
var dbytes = output.data;
var sbytes = stream.bytes;
- var sym = state.sym || readCode(sbytes, stream, literalTable);
+ var sym = state.sym !== null ? state.sym :
+ readCode(sbytes, stream, literalTable);
while (sym !== 256) {
if (sym < 256) {
dbytes[pos++] = sym;
} else {
state.sym = sym;
sym -= 257;
- var len = state.len || (state.len = lengthCodes[sym] + readBits(sbytes, stream, lengthExtraBits[sym]));
- var sym2 = state.sym2 || (state.sym2 = readCode(sbytes, stream, distanceTable));
+ var len = state.len !== null ? state.len :
+ (state.len = lengthCodes[sym] + readBits(sbytes, stream, lengthExtraBits[sym]));
+ var sym2 = state.sym2 !== null ? state.sym2 :
+ (state.sym2 = readCode(sbytes, stream, distanceTable));
var distance = distanceCodes[sym2] + readBits(sbytes, stream, distanceExtraBits[sym2]);
var i = pos - distance;
while (len--)
View
4 src/swf/parser.js
@@ -162,7 +162,9 @@ function CompressedPipe(target, length) {
this.length = length;
this.initialize = true;
this.buffer = new HeadTailBuffer(8096);
- this.state = { bitBuffer: 0, bitLength : 0, compression: {} };
+ this.state = { bitBuffer: 0, bitLength : 0, compression: {
+ header: null, distanceTable: null, literalTable: null,
+ sym: null, len: null, sym2: null } };
this.output = {
data: new Uint8Array(length),
available: 0,
Something went wrong with that request. Please try again.