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

TypeError: Cannot read property 'precision' of undefined #80

Closed
imanoracle opened this issue Oct 17, 2020 · 2 comments
Closed

TypeError: Cannot read property 'precision' of undefined #80

imanoracle opened this issue Oct 17, 2020 · 2 comments

Comments

@imanoracle
Copy link

Hi,

I got the following error with the provided input:

input:/Users/cydarien/Documents/test/jpeg/node_modules/jpeg-js/lib/decoder.js:95
    var precision = frame.precision;
                          ^

TypeError: Cannot read property 'precision' of undefined
    at decodeScan (/Users/cydarien/Documents/test/jpeg/node_modules/jpeg-js/lib/decoder.js:95:27)
    at constructor.parse (/Users/cydarien/Documents/test/jpeg/node_modules/jpeg-js/lib/decoder.js:744:29)
    at Object.decode (/Users/cydarien/Documents/test/jpeg/node_modules/jpeg-js/lib/decoder.js:1004:11)
    at Object.<anonymous> (/Users/cydarien/Documents/test/jpeg/test.js:5:6)
    at Module._compile (internal/modules/cjs/loader.js:1256:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1277:10)
    at Module.load (internal/modules/cjs/loader.js:1105:32)
    at Function.Module._load (internal/modules/cjs/loader.js:967:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

Code:

const jpeg = require('jpeg-js');
var fs = require('fs');

var buf = fs.readFileSync('crash');
jpeg.decode(buf);

crash.zip

@donmahallem
Copy link
Contributor

This is probably a duplicate/related to #63

@patrickhulce
Copy link
Collaborator

Indeed dupe of #63

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

No branches or pull requests

3 participants