1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

Merge pull request #17951 from timvandermeij/fix-jpx-decoder

Fix `JpxImage` API issues (PR 17946 follow-up)
This commit is contained in:
Tim van der Meij 2024-04-16 19:09:46 +02:00 committed by GitHub
commit 921fae556e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -25,7 +25,7 @@ class JpxError extends BaseException {
class JpxImage {
static #module = null;
static decode(data, ignoreColorSpace) {
static decode(data, ignoreColorSpace = false) {
this.#module ||= OpenJPEG();
const imageData = this.#module.decode(data, ignoreColorSpace);
if (!imageData) {

View file

@ -18,7 +18,7 @@ function ignoredError(error) {
*/
function fuzz(data) {
try {
new JpxImage().parse(new Uint8Array(data));
JpxImage.decode(new Uint8Array(data));
} catch (error) {
if (error.message && !ignoredError(error)) {
throw error;