Skip to content

[macOS] [Editor] NullReferenceException in DisplayUGUI.GetDrawingDimensions when MediaPlayer.Info is null #2501

Description

@mittan1330

Unity version

6000.3.19f1

Unity editor platform

macOS

AVPro Video edition

Ultra

AVPro Video version

3.4.2

Device hardware

Mac M4 Max

Which macOS version are you using?

15.7.5

Texture format

BGRA

Audio output

System Direct

Any other Media Player component configuration required to reproduce the issue.

Multiple MediaPlayer and DisplayUGUI components are created dynamically at runtime.
Each player has its own DisplayUGUI component. The components are destroyed when the video view is disposed.
The issue occurs in the macOS Unity Editor.

Which output component(s) are you using?

Display uGUI

Any other component configuration required to reproduce the issue.

No special configuration is required.
The issue appears to be related to the [ExecuteInEditMode] behavior added to DisplayUGUI. It occurs during a uGUI Canvas rebuild while the MediaPlayer is being initialized or disposed.

The issue

After upgrading AVPro Video Ultra from 3.3.3 to 3.4.2, we occasionally see the following exception when running the project in the macOS Unity Editor:

NullReferenceException: Object reference not set to an instance of an object
RenderHeads.Media.AVProVideo.DisplayUGUI.GetDrawingDimensions
    (UnityEngine.ScaleMode scaleMode, UnityEngine.Rect& uvRect)
    (at Assets/AVProVideo/Extensions/UnityUI/Runtime/DisplayUGUI.cs:620)
RenderHeads.Media.AVProVideo.DisplayUGUI._OnFillVBO
    (System.Collections.Generic.List`1[T] vbo)
    (at Assets/AVProVideo/Extensions/UnityUI/Runtime/DisplayUGUI.cs:547)
RenderHeads.Media.AVProVideo.DisplayUGUI.OnPopulateMesh
    (UnityEngine.UI.VertexHelper vh)
    (at Assets/AVProVideo/Extensions/UnityUI/Runtime/DisplayUGUI.cs:533)

We suspect that the following access to MediaPlayer.Info in GetDrawingDimensions() may be related:

_mediaPlayer.Info.GetTextureTransform()

HasValidTexture() checks MediaPlayer and TextureProducer, but it does not appear to check whether MediaPlayer.Info is available. It may therefore be possible for this code to run while Info is null, for example during player initialization or disposal.
Adding a null check for MediaPlayer.Info appears to prevent the exception in our project. Could you please confirm whether this is a known issue?

Media information

No response

Log output

Activity

  1. Reuben-RH commented on Sep 3, 2026

    @Reuben-RH

    Hi @mittan1330
    This issue has been fixed, and will be included in the next release.

  2. added
    FixedA fix will be in the next release
    and removed
    triageNeeds triage
    on Sep 3, 2026
  3. added this to the 3.4.3 milestone on Sep 3, 2026
  4. added
    UnityAn issue with AVPro Video and Unity that's not specific to any platform
    and removed
    macOSmacOS platform
    on Sep 3, 2026
  5. mittan1330 commented on Sep 3, 2026

    @mittan1330
    Author

    @Reuben-RH
    Thank you for the update!
    I appreciate the fix and look forward to the next release.

  6. Chris-RH commented on Sep 29, 2026

    @Chris-RH
    Contributor

    AVPro Video version 3.4.3 has been released. Please let us know if it has not fixed your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

FixedA fix will be in the next releaseUnityAn issue with AVPro Video and Unity that's not specific to any platform

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions