diff --git a/src/core/jpg.js b/src/core/jpg.js index de3673879252f..08a992afd3752 100644 --- a/src/core/jpg.js +++ b/src/core/jpg.js @@ -1073,6 +1073,9 @@ class JpegImage { offset += 2; } + if (!frame) { + throw new JpegError("JpegImage.parse - no frame data found."); + } this.width = frame.samplesPerLine; this.height = frame.scanLines; this.jfif = jfif;