compositor: Attach only valid background buffers
If a background is not found, create_buffer_from_png will return NULL. Do not attach these buffers.
This commit is contained in:
committed by
Kristian Høgsberg
parent
ecfb2b93f3
commit
d3b023ed7d
@@ -309,6 +309,10 @@ background_create(struct wlsc_output *output, const char *filename)
|
|||||||
buffer = create_buffer_from_png(output->compositor,
|
buffer = create_buffer_from_png(output->compositor,
|
||||||
filename,
|
filename,
|
||||||
output->width, output->height);
|
output->width, output->height);
|
||||||
|
if (buffer == NULL) {
|
||||||
|
free(background);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
buffer->attach(buffer, &background->surface);
|
buffer->attach(buffer, &background->surface);
|
||||||
|
|
||||||
return background;
|
return background;
|
||||||
|
|||||||
Reference in New Issue
Block a user