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:
commit
921fae556e
2 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue