Skip to content

decklink: Output crashes on a saved mode the device lacks, and on an HDR start with no conversion #2144

Closed

Description

@rdoupe

Bugs

DeckLink output dereferences two pointers without checking them. Both were found while fixing #2127, by reading the code; nothing was run on DeckLink hardware.

1. A saved output mode that the device doesn't have

DeckLinkDeviceMode *mode = device->FindOutputMode(modeID) returns NULL when the mode ID isn't one the device offers. Both uses dereference it straight away (plugins/decklink/decklink-output.cpp):

  • decklink_output_create() reads mode->GetWidth() and GetHeight() for the conversion;
  • the output start calls mode->IsEqualFrameRate() and mode->GetWidth().

The mode ID comes from saved settings: the DeckLink Output dialog, a plugin or a script. So a settings file written for another card, firmware or device under the same ID crashes OBS when the output is created or started.

2. An HDR start with no conversion

DeckLinkDeviceInstance::StartOutput() (decklink-device-instance.cpp) reads obs_output_get_video_conversion(...)->colorspace without a NULL check when the source is HDR (PQ or HLG). The conversion is NULL when decklink_output_create() didn't find the device: for example, an output created while the card was missing and started after it appeared. #2142 adds one more case, when the output has a scaled size and no video, but DeckLink doesn't set a scaled size.

Upstream has the same code.

Plan

  • When the mode is missing, decklink_output_create() and the output start log an error and fail the start, the way the start already fails for a frame-rate mismatch.
  • StartOutput() treats a NULL conversion as not HDR, or fails the start; pick whichever matches the plugin's other failure paths.
  • Verification: the Windows and macOS builds, plus reading the code. Neither path can be tested here without DeckLink hardware.

Activity

  1. zackees commented on Oct 24, 2026

    @zackees
    Member

    Claiming: this issue.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions