exifreader 4.40.4 → 4.40.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exifreader",
3
- "version": "4.40.4",
3
+ "version": "4.40.5",
4
4
  "description": "Library that parses Exif metadata in images.",
5
5
  "author": "Mattias Wallander <mattias@wallander.eu>",
6
6
  "repository": {
package/src/icc-tags.js CHANGED
@@ -89,6 +89,7 @@ function doesNotHaveTagData(dataView, tagHeaderOffset) {
89
89
  }
90
90
 
91
91
  export function parseTags(dataView) {
92
+ const MAX_MLUC_RECORDS = 1000;
92
93
  const buffer = dataView.buffer;
93
94
 
94
95
  const length = dataView.getUint32();
@@ -164,6 +165,9 @@ export function parseTags(dataView) {
164
165
  if (recordSize < MIN_MULTI_LOCALIZED_UNICODE_RECORD_SIZE) {
165
166
  return tags;
166
167
  }
168
+ if (numRecords > MAX_MLUC_RECORDS) {
169
+ return tags;
170
+ }
167
171
  const recordsSize = numRecords * recordSize;
168
172
  const availableRecordsSize = dataView.byteLength - tagOffset
169
173
  - MULTI_LOCALIZED_UNICODE_RECORDS_OFFSET;