Sign in to follow this  
Ishi

Crash after copying a large image into clipboard

Recommended Posts

So I have a single layer picture opened on PDN v.4.0.21. I did some changes to it and CTRL+A then attempted to copy it to the clipboard FROM PDN to another program being MS Publisher, then I get an error on PDN saying it failed to load the image into the clipboard. I get this error log.

System.ComponentModel.Win32Exception (0x80004005): HeapAlloc() returned NULL (requestedSize = 137,816,064 bytes) (0, ERROR_SUCCESS)   at PaintDotNet.SystemLayer.NativeUtilities.ThrowOnWin32Error(String message, Int32 lastWin32Error, Boolean alwaysThrow) in D:\src\pdn\src\SystemLayer\NativeUtilities.cs:line 88   at PaintDotNet.SystemLayer.MemoryManagement.HeapBuffer..ctor(HeapAllocator heap, Int64 size, AllocationOptions flags) in D:\src\pdn\src\SystemLayer\MemoryManagement\HeapBuffer.cs:line 68   at PaintDotNet.SystemLayer.MemoryManagement.HeapAllocator.Allocate(Int64 size, AllocationOptions flags) in D:\src\pdn\src\SystemLayer\MemoryManagement\HeapAllocator.cs:line 63   at PaintDotNet.MemoryManagement.Proxies.AllocatorProxy.Allocate(Int64 size, AllocationOptions flags) in D:\src\pdn\src\Base\MemoryManagement\Proxies\AllocatorProxy.cs:line 56   at PaintDotNet.IO.NativeMemoryStream.set_Capacity(Int64 value) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 111   at PaintDotNet.IO.NativeMemoryStream.EnsureCapacity(Int64 desiredCapacity) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 411   at PaintDotNet.IO.NativeMemoryStream.Write(Byte* pBuffer, Int64 count) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 307   at PaintDotNet.IO.NativeMemoryStream.Write(Byte[] buffer, Int64 offset, Int64 count) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 283   at PaintDotNet.IO.NativeMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 268   at System.IO.BinaryWriter.Write(Byte[] buffer)   at System.Runtime.Serialization.Formatters.Binary.__BinaryWriter.WriteSingleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, Int32 length, Int32 lowerBound, Array array)   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray(WriteObjectInfo objectInfo, NameInfo memberNameInfo, WriteObjectInfo memberObjectInfo)   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)   at PaintDotNet.SystemLayer.Clipboard.Transaction.<>c__DisplayClass13_0.<AddManagedData>b__0(Stream dataStream) in D:\src\pdn\src\SystemLayer\Clipboard.cs:line 335   at PaintDotNet.SystemLayer.Clipboard.Transaction.AddRawNativeData(UInt32 formatID, Action`1 copyToStreamFn) in D:\src\pdn\src\SystemLayer\Clipboard.cs:line 363   at PaintDotNet.SystemLayer.Clipboard.Transaction.AddManagedData(Object data) in D:\src\pdn\src\SystemLayer\Clipboard.cs:line 330   at PaintDotNet.Actions.CopyToClipboardActionBase.PerformAction() in D:\src\pdn\src\PaintDotNet\Actions\CopyToClipboardActionBase.cs:line 98

 

Share this post


Link to post
Share on other sites

Its a problem that causes PDN to display that dialog box that also shows the error log but it does not really grind PDN to a stop. Here's the error log again. I used the forum function to insert a line of code. I think it does not behave as it once used to.

 

System.ComponentModel.Win32Exception (0x80004005): HeapAlloc() returned NULL (requestedSize = 137,816,064 bytes) (0, ERROR_SUCCESS)   at PaintDotNet.SystemLayer.NativeUtilities.ThrowOnWin32Error(String message, Int32 lastWin32Error, Boolean alwaysThrow) in D:\src\pdn\src\SystemLayer\NativeUtilities.cs:line 88   at PaintDotNet.SystemLayer.MemoryManagement.HeapBuffer..ctor(HeapAllocator heap, Int64 size, AllocationOptions flags) in D:\src\pdn\src\SystemLayer\MemoryManagement\HeapBuffer.cs:line 68   at PaintDotNet.SystemLayer.MemoryManagement.HeapAllocator.Allocate(Int64 size, AllocationOptions flags) in D:\src\pdn\src\SystemLayer\MemoryManagement\HeapAllocator.cs:line 63   at PaintDotNet.MemoryManagement.Proxies.AllocatorProxy.Allocate(Int64 size, AllocationOptions flags) in D:\src\pdn\src\Base\MemoryManagement\Proxies\AllocatorProxy.cs:line 56   at PaintDotNet.IO.NativeMemoryStream.set_Capacity(Int64 value) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 111   at PaintDotNet.IO.NativeMemoryStream.EnsureCapacity(Int64 desiredCapacity) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 411   at PaintDotNet.IO.NativeMemoryStream.Write(Byte* pBuffer, Int64 count) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 307   at PaintDotNet.IO.NativeMemoryStream.Write(Byte[] buffer, Int64 offset, Int64 count) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 283   at PaintDotNet.IO.NativeMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) in D:\src\pdn\src\Base\IO\NativeMemoryStream.cs:line 268   at System.IO.BinaryWriter.Write(Byte[] buffer)   at System.Runtime.Serialization.Formatters.Binary.__BinaryWriter.WriteSingleArray(NameInfo memberNameInfo, NameInfo arrayNameInfo, WriteObjectInfo objectInfo, NameInfo arrayElemTypeNameInfo, Int32 length, Int32 lowerBound, Array array)   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray(WriteObjectInfo objectInfo, NameInfo memberNameInfo, WriteObjectInfo memberObjectInfo)   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)   at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)   at PaintDotNet.SystemLayer.Clipboard.Transaction.<>c__DisplayClass13_0.<AddManagedData>b__0(Stream dataStream) in D:\src\pdn\src\SystemLayer\Clipboard.cs:line 335   at PaintDotNet.SystemLayer.Clipboard.Transaction.AddRawNativeData(UInt32 formatID, Action`1 copyToStreamFn) in D:\src\pdn\src\SystemLayer\Clipboard.cs:line 363   at PaintDotNet.SystemLayer.Clipboard.Transaction.AddManagedData(Object data) in D:\src\pdn\src\SystemLayer\Clipboard.cs:line 330   at PaintDotNet.Actions.CopyToClipboardActionBase.PerformAction() in D:\src\pdn\src\PaintDotNet\Actions\CopyToClipboardActionBase.cs:line 98

Share this post


Link to post
Share on other sites

This is not a bug. Paint.NET needed to allocate memory and it couldn't, so it told you instead of crashing.

 

Are you using a 64-bit edition of Windows? If not, I recommend you switch to that.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this