Problem with decompressing algorithm in firefox (works in chrome/edge)

34 Views Asked by At

Background:

In a corporate project were using the Open Source Framework PXT (Microsoft Makecode). In PXT its possible to upload projects which are in the format of .png and they include the whole meta-data. Uploading a project in Chrome and Edge is no problem, but in firefox it causes the ERROR: corrupted input.

Problem:

The pxt-framework uses the lzma-algorithm to decompress the .png-projects (https://github.com/microsoft/pxt/blob/master/pxtlib/cpp.ts) The Error which appears when uploading a File ~>14.2KB in Firefox is a corrupted input within the lzma.decompress function -> input: the buffer(project) as a Uint8Array -> output: res (decompressed project as a string) and error

Error caused by:

Function sr returns value -1 if variable e.ib got the value -1

Function tr throws a error if function sr returns -1

Loop which returns the decompressed project:

Loop which returns the decompressed project

Return of a project >14.2KB: (ERROR)

enter image description here

enter image description here

Return of a project <14.2KB: (SUCCESS)

enter image description here

enter image description here

What I suggest:

The loop is responsible for decompressing the project, it also monitors the execution time. Presumably the execution time in Firefox is too long for large projects and therefore the decompressing process failes with a time out.

Anyone faced something similar and can help out? In fact that it only appears in firefox and only for projects >14.2KB I guess it can be solved by changing a parameter in the browser config.

Hope someone got a idea :-)

Increasing the timeout time -> no effect

0

There are 0 best solutions below