Skip to content

Conversation

@SpencerLommel
Copy link
Contributor

This PR addresses #253 by adding NULL checks for gvc_mixer_card_get_profile() in two locations:

  • gvc_mixer_ui_device_get_matching_profile() (in gvc-mixer-ui-device.c)
  • gvc_mixer_control_change_output() (in gvc-mixer-control.c)

Previously, if gvc_mixer_card_get_profile() returned NULL (e.g., during initial Bluetooth connection), it could cause Cinnamon to crash into fallback mode. These checks prevent that by logging a warning and safely returning a value that can be handled (NULL & FALSE)

Tested locally with Sony WH-1000XM4 headphones on Linux Mint 21.3.

@SpencerLommel
Copy link
Contributor Author

I've tested this all day yesterday and today on my computers that run LM and I haven't ran into any issues so far!

@mtwebster mtwebster requested a review from Copilot April 16, 2025 13:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a potential crash scenario by adding NULL checks for the return value of gvc_mixer_card_get_profile() in two functions, preventing subsequent dereference and fallback crashes.

  • Adds a NULL check in gvc_mixer_ui_device_get_active_profile() to log a warning and return NULL.
  • Adds a NULL check in gvc_mixer_control_change_profile_on_selected_device() to log a warning and return FALSE.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
libcvc/gvc-mixer-ui-device.c Added a NULL check to ensure safe handling when gvc_mixer_card_get_profile() returns NULL.
libcvc/gvc-mixer-control.c Added a NULL check to handle cases where gvc_mixer_card_get_profile() returns NULL and avoid crashes.

@mtwebster mtwebster merged commit 1e68cdb into linuxmint:master Apr 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants