# ImagePtr-\>Save() throws InvalidCiphertext

**URL:** <https://forum.commonvisionblox.com/t/imageptr-save-throws-invalidciphertext/1090>\
**Category:** General Questions\
**Tags:** exceptions\
**Created:** [March 31, 2020, 8:39am UTC](https://forum.commonvisionblox.com/t/imageptr-save-throws-invalidciphertext/1090 "2020-03-31T08:39:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![withnail99](https://avatars.discourse-cdn.com/v4/letter/w/c6cbf5/32.png) [@withnail99](https://forum.commonvisionblox.com/u/withnail99)\
**Post date:** [March 31, 2020, 8:39am UTC](https://forum.commonvisionblox.com/t/imageptr-save-throws-invalidciphertext/1090/1 "2020-03-31T08:39:50Z")

</div>

Whenver I call ImagePtr-\>Save() to write an image to disk (as PNG or JPG), the write succeeds, but I get the following logs:

‘tim.exe’ (Win32): Loaded ‘C:\Program Files\STEMMER IMAGING\Common Vision Blox\CVCFile.dll’.  
‘tim.exe’ (Win32): Loaded ‘C:\Windows\System32\comdlg32.dll’.  
‘tim.exe’ (Win32): Loaded ‘C:\Windows\WinSxS\amd64\_microsoft.windows.common-controls\_6595b64144ccf1df\_6.0.18362.720\_none\_e6beb5c51314836b\comctl32.dll’.  
Exception thrown at 0x00007FF8B8FAA859 in tim.exe: Microsoft C++ exception: CryptoPP::InvalidCiphertext at memory location 0x000000489F6FCE30.  
Exception thrown at 0x00007FF8B8FAA859 in tim.exe: Microsoft C++ exception: CryptoPP::InvalidCiphertext at memory location 0x000000489F6FCE10.  
‘tim.exe’ (Win32): Unloaded ‘C:\Windows\WinSxS\amd64\_microsoft.windows.common-controls\_6595b64144ccf1df\_6.0.18362.720\_none\_e6beb5c51314836b\comctl32.dll’  
‘tim.exe’ (Win32): Unloaded ‘C:\Windows\System32\comdlg32.dll’  
‘tim.exe’ (Win32): Unloaded ‘C:\Program Files\STEMMER IMAGING\Common Vision Blox\CVCFile.dll’

Where is the InvalidCiphertext coming from?

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![TStadler](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/tstadler/32/308_2.png) [@TStadler](https://forum.commonvisionblox.com/u/TStadler)\
**Post date:** [April 6, 2020, 6:49am UTC](https://forum.commonvisionblox.com/t/imageptr-save-throws-invalidciphertext/1090/2 "2020-04-06T06:49:48Z")

</div>

Hi Tim,

these are exceptions in the CryptoPP library that CVB uses.  
They can be safely ignored.

Cheers,  
Tim

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [November 4, 2021, 2:59pm UTC](https://forum.commonvisionblox.com/t/imageptr-save-throws-invalidciphertext/1090/3 "2021-11-04T14:59:47Z")

</div>

More importantly: These are first chance exceptions - occasions where the control flow in the application has encountered a `throw` statement, but the thrown exception has been caught by a `catch` block (as opposed to uncaught exceptions, where the exception travels up the call stack and eventually terminates the running process.  
The latter kind is the kind that gives rise to “crashed” applications. The former one is just a valid way to affect the control flow in the application/library. Unfortunately, every `throw` statement produces such a line in the trace output, but as @TStadler pointed out these may be safely ignored…
