Skip to content

Fix crash clearing filter list when filter graph is disabled#20

Open
colincoleman wants to merge 2 commits into
xyzzy42:masterfrom
colincoleman:fix-filter-dialog-null-image-crash
Open

Fix crash clearing filter list when filter graph is disabled#20
colincoleman wants to merge 2 commits into
xyzzy42:masterfrom
colincoleman:fix-filter-dialog-null-image-crash

Conversation

@colincoleman

Copy link
Copy Markdown

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.

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>
@colincoleman

Copy link
Copy Markdown
Author

Found this bug while working on the Auto tune feature

@xyzzy42

xyzzy42 commented Jun 20, 2026

Copy link
Copy Markdown
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>
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