We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0c3452b + da59f94 commit 3db5330Copy full SHA for 3db5330
Source/com/drew/metadata/icc/IccDescriptor.java
@@ -21,6 +21,7 @@
21
22
package com.drew.metadata.icc;
23
24
+import com.drew.lang.BufferBoundsException;
25
import com.drew.lang.ByteArrayReader;
26
import com.drew.lang.RandomAccessReader;
27
import com.drew.lang.annotations.NotNull;
@@ -91,6 +92,11 @@ private String getTagDataString(int tagType)
91
92
}
93
case ICC_TAG_TYPE_DESC:
94
int stringLength = reader.getInt32(8);
95
+
96
+ if (stringLength < 0 || stringLength > (bytes.length - 12)) {
97
+ throw new BufferBoundsException(12, stringLength, bytes.length);
98
+ }
99
100
return new String(bytes, 12, stringLength - 1);
101
case ICC_TAG_TYPE_SIG:
102
return IccReader.getStringFromInt32(reader.getInt32(8));
0 commit comments