exifreader 4.41.4 → 4.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/exif-reader.js +1 -1
- package/dist/exif-reader.js.map +1 -1
- package/package.json +1 -1
- package/src/icc-tags.js +5 -2
package/package.json
CHANGED
package/src/icc-tags.js
CHANGED
|
@@ -48,11 +48,14 @@ function compressionMethodIsSupported(compressionMethod) {
|
|
|
48
48
|
|
|
49
49
|
function readIcc(dataView, iccData) {
|
|
50
50
|
try {
|
|
51
|
-
const
|
|
51
|
+
const buffer = getBuffer(dataView);
|
|
52
|
+
const declaredLength = iccData.reduce((sum, icc) => sum + icc.length, 0);
|
|
53
|
+
// The declared chunk lengths come from the file and are not trusted, so
|
|
54
|
+
// bound the profile by the size of the buffer it is copied out of.
|
|
55
|
+
const totalIccProfileLength = Math.min(declaredLength, buffer.byteLength);
|
|
52
56
|
|
|
53
57
|
const iccBinaryData = new Uint8Array(totalIccProfileLength);
|
|
54
58
|
let offset = 0;
|
|
55
|
-
const buffer = getBuffer(dataView);
|
|
56
59
|
|
|
57
60
|
for (let chunkNumber = 1; chunkNumber <= iccData.length; chunkNumber++) {
|
|
58
61
|
const iccDataChunk = iccData.find((x) => x.chunkNumber === chunkNumber);
|