Fix crash clearing filter list when filter graph is disabled#20
Open
colincoleman wants to merge 2 commits into
Open
Fix crash clearing filter list when filter graph is disabled#20colincoleman wants to merge 2 commits into
colincoleman wants to merge 2 commits into
Conversation
filter_selected() and filter_graph_toggled() call gtk_image_clear() on priv->image whenever the selection is cleared or the graph is toggled off. But priv->image is only created when HAVE_FILTERGRAPH is enabled; in builds without it the pointer is NULL, so gtk_image_clear(NULL) dereferences a NULL pointer and crashes. This is reachable in a normal build by removing the last filter from the chain (which clears the selection). Guard both calls with a NULL check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
|
Found this bug while working on the Auto tune feature |
Owner
|
In builds which do have the filter graph, the image can't be NULL. That's part of the design. I think the correct solution would be the guard clearing the graph when all filters are removed to only happen with the filter graph is enabled. |
Per review: priv->image is only allocated when the filter graph is compiled in, so guard the gtk_image_clear() in filter_selected() with #if HAVE_FILTERGRAPH instead of a runtime NULL check. Revert the filter_graph_toggled() change, since that handler is only connected when the graph is enabled and so never runs with a NULL image. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
filter_selected() and filter_graph_toggled() call gtk_image_clear() on priv->image whenever the selection is cleared or the graph is toggled off. But priv->image is only created when HAVE_FILTERGRAPH is enabled; in builds without it the pointer is NULL, so gtk_image_clear(NULL) dereferences a NULL pointer and crashes.
This is reachable in a normal build by removing the last filter from the chain (which clears the selection). Guard both calls with a NULL check.