Throw a JpegError when a JPEG image has no frame data (issue 17302)

Given that there's nothing to parse in this case, since we're dealing with an invalid JPEG image, throwing an *explicit* Error makes sense here.
This commit is contained in:
Jonas Jenwald 2023-11-20 17:33:49 +01:00
parent d8424a43ba
commit a6f0609a6e

View File

@ -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;