From 485a0062159ab1e4314e9dc4de7eef2d87edfd85 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 17 Oct 2015 06:06:38 -0700 Subject: [PATCH] libobs: Check source textures before destroying Check to make sure the texrenders and textures on a source are valid before destroying. --- libobs/obs-source.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 52c11b38f..d63e95125 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -370,9 +370,12 @@ void obs_source_destroy(struct obs_source *source) obs_source_frame_decref(source->async_cache.array[i].frame); gs_enter_context(obs->video.graphics); - gs_texrender_destroy(source->async_convert_texrender); - gs_texture_destroy(source->async_texture); - gs_texrender_destroy(source->filter_texrender); + if (source->async_convert_texrender) + gs_texrender_destroy(source->async_convert_texrender); + if (source->async_texture) + gs_texture_destroy(source->async_texture); + if (source->filter_texrender) + gs_texrender_destroy(source->filter_texrender); gs_leave_context(); for (i = 0; i < MAX_AV_PLANES; i++)