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

Crash/TypeError #112

Open
Deng-dc opened this issue Jun 7, 2023 · 0 comments
Open

Crash/TypeError #112

Deng-dc opened this issue Jun 7, 2023 · 0 comments
Labels

Comments

@Deng-dc
Copy link

Deng-dc commented Jun 7, 2023

it looks like the follow code can triger an TypeError

jpeg.decode(Buffer.from("ffd8ffdaffff0001", "hex"));

here is the stack trace

var precision = frame.precision;
                          ^

TypeError: Cannot read properties of undefined (reading 'precision')
    at decodeScan (C:\development\jsfuzz\jpeg\node_modules\jpeg-js\lib\decoder.js:97:27)
    at constructor.parse (C:\development\jsfuzz\jpeg\node_modules\jpeg-js\lib\decoder.js:812:29)
    at Object.decode (C:\development\jsfuzz\jpeg\node_modules\jpeg-js\lib\decoder.js:1116:11)
    at Object.<anonymous> (C:\development\jsfuzz\jpeg\reproducer.js:6:6)

next is another example

jpeg.decode(Buffer.from("ffd8ffdaff04aeff68", "hex"));

here is the stack trace

component = frame.components[data[offset++]];
                                ^

TypeError: Cannot read properties of undefined (reading 'components')
    at constructor.parse (C:\development\jsfuzz\jpeg\node_modules\jpeg-js\lib\decoder.js:803:33)
    at Object.decode (C:\development\jsfuzz\jpeg\node_modules\jpeg-js\lib\decoder.js:1116:11)
    at Object.<anonymous> (C:\development\jsfuzz\jpeg\reproducer.js:7:6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants