mirror of
https://github.com/greenshot/greenshot
synced 2025-07-30 11:40:40 -07:00
This should hopefully fix an overflow exception while decoding the dib format.
This commit is contained in:
parent
48675b01f0
commit
bfa8e2444e
1 changed files with 1 additions and 2 deletions
|
@ -100,8 +100,7 @@ namespace Greenshot.Editor.FileFormatHandlers
|
||||||
bitmap = new Bitmap(infoHeader.Width, infoHeader.Height,
|
bitmap = new Bitmap(infoHeader.Width, infoHeader.Height,
|
||||||
-(int)(infoHeader.SizeImage / infoHeader.Height),
|
-(int)(infoHeader.SizeImage / infoHeader.Height),
|
||||||
infoHeader.BitCount == 32 ? PixelFormat.Format32bppArgb : PixelFormat.Format24bppRgb,
|
infoHeader.BitCount == 32 ? PixelFormat.Format32bppArgb : PixelFormat.Format24bppRgb,
|
||||||
new IntPtr(handle.AddrOfPinnedObject().ToInt32() + infoHeader.OffsetToPixels +
|
IntPtr.Add(handle.AddrOfPinnedObject(), (int)infoHeader.OffsetToPixels + (infoHeader.Height - 1) * (int)(infoHeader.SizeImage / infoHeader.Height))
|
||||||
(infoHeader.Height - 1) * (int)(infoHeader.SizeImage / infoHeader.Height))
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue