Skip to content

Commit 94fd614

Browse files
committed
Check range-specific values in layerbreak
1 parent 9fc5799 commit 94fd614

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELIST.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### WIP (xxxx-xx-xx)
22

33
- Check for null or empty layerbreak arrays
4+
- Check range-specific values in layerbreak
45

56
### 3.6.0 (2025-11-28)
67

MPF.Processors/ProcessingTool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ public static bool GetLayerbreaks(DiscInformation? di, out long? layerbreak1, ou
253253
// Wrap big-endian reading
254254
static int ReadFromArrayBigEndian(byte[]? bytes, int offset)
255255
{
256-
if (bytes.IsNullOrEmpty())
256+
if (bytes == null || bytes.Length < offset + 4)
257257
return default;
258258

259-
return bytes!.ReadInt32BigEndian(ref offset);
259+
return bytes.ReadInt32BigEndian(ref offset);
260260
}
261261

262262
// Layerbreak 1 (2+ layers)

0 commit comments

Comments
 (0)