# Possible SDK bug in 5.2.1

**URL:** <https://community.stereolabs.com/t/possible-sdk-bug-in-5-2-1/10948>\
**Category:** C#\
**Tags:** sdk\
**Created:** [March 4, 2026, 8:02am UTC](https://community.stereolabs.com/t/possible-sdk-bug-in-5-2-1/10948 "2026-03-04T08:02:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebtous](https://community.stereolabs.com/user_avatar/community.stereolabs.com/sebtous/32/5896_2.png) [@Sebtous](https://community.stereolabs.com/u/Sebtous)\
**Post date:** [March 4, 2026, 8:02am UTC](https://community.stereolabs.com/t/possible-sdk-bug-in-5-2-1/10948/1 "2026-03-04T08:02:41Z")

</div>

When using the SDK 5.2.1 in combination with the .NET/c# bindings the following command now returns an `sl.ERROR_CODE.INVALID_FUNCTION_PARAMETERS` error code where it would work fine with SDK 5.1:

`s.Camera.RetrieveImage ( Buf, sl.VIEW.LEFT_BGR );`

Then, immediately after the `sl_zed64.dll` irreparably crashes the whole process with this exception:

`Exception thrown at 0x00007FFDCA5BA80A in ZED\_Depth\_Sensing.exe: Microsoft C++ exception: std::system\_error at memory location 0x000000D4471EF8E0

And this call stack:

```  
KernelBase.dll!00007ffdca5ba80a() Unknown  
vcruntime140.dll!00007ffda2815277() Unknown  
msvcp140.dll!00007ffda2792c96() Unknown  
msvcp140.dll!00007ffda2792c41() Unknown  
sl\_zed64.dll!00007ffc7972a0b9() Unknown  
sl\_zed64.dll!00007ffc7cf7d90b() Unknown  
sl\_zed\_c.dll!00007ffd9392ed5a() Unknown  
```

I am testing using a ZED 2i camera.

It’s fairly ease to reproduce this by modifying the SDK’s [ZED\_Depth\_Sensing](https://github.com/stereolabs/zed-sdk/tree/master/depth%20sensing/depth%20sensing/csharp) sample code as follows:

At line 168 of `mainwindow.cs`, insert:

var Res = new sl.Resolution ( zedCamera.ImageWidth, zedCamera.ImageHeight );  
var Buf = new sl.Mat ();  
Buf.Create ( Res, sl.MAT\_TYPE.MAT\_8U\_C3, sl.MEM.CPU );  
var Result = zedCamera.RetrieveImage ( Buf, sl.VIEW.LEFT\_BGR );

Then run the example using SDK 5.2.1 and witness the error code and subsequent crash.

---

<div class="post-metadata">

**Author:** ![BenjaminV](https://community.stereolabs.com/user_avatar/community.stereolabs.com/benjaminv/32/3863_2.png) [@BenjaminV](https://community.stereolabs.com/u/BenjaminV)\
**Post date:** [March 4, 2026, 9:25am UTC](https://community.stereolabs.com/t/possible-sdk-bug-in-5-2-1/10948/2 "2026-03-04T09:25:40Z")

</div>

Hi,

Thanks for the report.

I tested and confirm the issue, which was a combination of a bug in the SDK and in the wrapper itself).  
I’ll update the wrappers soonso you’ll be able to retrieve the `LEFT_BGR` image. The underlying crash will be addressed in the next patch of the ZED SDK.
