# AccessViolationException on VideoRenderElement SetPos

**URL:** <https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689>\
**Category:** Windows\
**Created:** [February 18, 2021, 3:29pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689 "2021-02-18T15:29:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankocorp.com](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ankocorp.com/32/10249_2.png) [@ankocorp.com](https://devforum.zoom.us/u/ankocorp.com)\
**Post date:** [February 18, 2021, 3:29pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/1 "2021-02-18T15:29:11Z")

</div>

We use C# wrapper over Windows SDK (5.2.41727.0928) in our WinForm Application. We render videos using Customized UI Service.

We are getting **AccessViolationException** from the video element for participants that disconnected from the meeting due to unexpected issues (i.e. network error) when calling `videoRenderElement.SetPos`. Such participants look like they are in the meeting, they are on the participants’ list, but they are actually disconnected.

This happens only when the normal video for such users excess 850px in height.

We create container (ICustomizedVideoContainerDotNetWrap) by calling

```auto
CZoomSDKeDotNetWrap.Instance.GetCustomizedUIMgrWrap().CreateVideoContainer.

```

Then create video:

```auto
var videoRenderElement = container.CreateVideoElement(VideoRenderElementType.VideoRenderElement_NORMAL);

```

Set the desired position

```auto
videoRenderElement.SetPos(rectPosNormal);

```

Subscribed to a user

```auto
videoRenderElement.Subscribe(_userId);
videoRenderElement.Show();

```

The crash happens ( **AccessViolationException** ) when we call with height more than 850, if height less everything is ok.

```auto
rectPosNormal.Height = 851;
videoRenderElement.SetPos(rectPosNormal);

```

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [February 18, 2021, 10:35pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/2 "2021-02-18T22:35:57Z")

</div>

Hey @ankocorp.com,

Thanks for using the dev forum!

Are you also seeing the same behavior on the latest version of the windows SDK?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![ankocorp.com](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ankocorp.com/32/10249_2.png) [@ankocorp.com](https://devforum.zoom.us/u/ankocorp.com)\
**Post date:** [March 3, 2021, 12:37pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/3 "2021-03-03T12:37:49Z")

</div>

We updated SDK, and the initial problem with **AccessViolationException** was resolved, however as we create 3 controls with video to form, with 2 external participant video, this method hangs and loads a single CPU core to 100%.

Condition to reproduce this issue, 2 external video must be resized

```auto
videoRenderElement.SetPos(rectPosNormal)

```

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [March 3, 2021, 10:08pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/4 "2021-03-03T22:08:24Z")

</div>

Hey @ankocorp.com,

Hmm I am curious if this may be related to the issue in this thread:

> [@WindowsSDK normal video render bug with many users](https://devforum.zoom.us/t/windowssdk-normal-video-render-bug-with-many-users/44584/3):
>
> Thanks for the quick response @Michael_Condon ! Here’s a link to the log files from my debugging today: The very last items in that log should be from when I took the attached video

Would you be able to update to the latest version of the SDK and see if this still happens?

Michael

---

<div class="post-metadata">

**Author:** ![asm.jaime](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/asm.jaime/32/24034_2.png) [@asm.jaime](https://devforum.zoom.us/u/asm.jaime)\
**Post date:** [March 4, 2021, 3:04pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/5 "2021-03-04T15:04:38Z")

</div>

Hi @Michael_Condon,

> [@Michael\_Condon](#):
>
> this may be related

I don’t think so. @wclare had problem with render video stream.  
We have problem with an unhandled exception.  
Infinity loop happens when at least two different participants on the same window equal more than 700-800 vertical or horizontal pixel and the function SetPos called one time. No exceptions. No information.  
Looks like SetPos in DuiLib.dll/sdk.dll does not work properly when rectangle setted out of container range. And the only when here’s two or more users.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [March 4, 2021, 7:20pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/6 "2021-03-04T19:20:13Z")

</div>

Hey @asm.jaime,

I see. Thank you! @ankocorp.com let me know what happens after you update.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![asm.jaime](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/asm.jaime/32/24034_2.png) [@asm.jaime](https://devforum.zoom.us/u/asm.jaime)\
**Post date:** [March 5, 2021, 9:34am UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/7 "2021-03-05T09:34:40Z")

</div>

@Michael_Condon Current version 5.4.54802.124. Already updated. Same problem.  
(We work together with @ankocorp.com on the same app).

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [March 5, 2021, 10:56pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/8 "2021-03-05T22:56:15Z")

</div>

Hey @asm.jaime,

I see, would you be able to send a demo application over to [DeveloperSupport@zoom.us](mailto:DeveloperSupport@zoom.us) along with your SDK logs so that we can investigate?

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![asm.jaime](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/asm.jaime/32/24034_2.png) [@asm.jaime](https://devforum.zoom.us/u/asm.jaime)\
**Post date:** [March 11, 2021, 3:52pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/9 "2021-03-11T15:52:21Z")

</div>

Hi @Michael_Condon. Problem solved during reproducing problem in the demo. Sorry, it was on our side. (wrong multiple time subscribe/unsibscribe cause many problems).

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [March 11, 2021, 11:06pm UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/10 "2021-03-11T23:06:27Z")

</div>

Hey @asm.jaime,

Oh ok, thank you for letting us know! I am glad the issue is solved now 🙂 Let us know if you run into any other issues.

Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 11, 2021, 9:06am UTC](https://devforum.zoom.us/t/accessviolationexception-on-videorenderelement-setpos/43689/11 "2021-04-11T09:06:55Z")

</div>

Closed on April 11, 2021, 9:06am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
