mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-11-24 16:53:20 +08:00
Check for array size before slice in ColorSpaceDetailsByteConverter.Convert()
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
var strideWidth = decoded.Length / imageHeight / bytesPerPixel;
|
||||
if (strideWidth != imageWidth)
|
||||
{
|
||||
if (bytesPerPixel > 1)
|
||||
if (bytesPerPixel > 1 && imageWidth * imageHeight * bytesPerPixel < decoded.Length)
|
||||
{
|
||||
// Fixed thanks to / see discussion at https://github.com/UglyToad/PdfPig/issues/1183
|
||||
// Unclear what should be done here, we assume we can just remove the trailing bytes
|
||||
|
||||
Reference in New Issue
Block a user