From 67e1db09d38d3cb67d09eb0fe0cfb576f3d93485 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 26 May 2016 10:09:57 -0500 Subject: [PATCH] FS-9198 #resolve [Small memory leaks in mod_skinny] --- .../applications/mod_conference/conference_video.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index eb69e2e192..d1d057f8f5 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -330,9 +330,13 @@ void conference_video_reset_image(switch_image_t *img, switch_rgb_color_t *color void conference_video_clear_layer(mcu_layer_t *layer) { - switch_img_fill(layer->canvas->img, layer->x_pos, layer->y_pos, layer->screen_w, layer->screen_h, &layer->canvas->bgcolor); + if (layer->canvas && layer->canvas->img) { + switch_img_fill(layer->canvas->img, layer->x_pos, layer->y_pos, layer->screen_w, layer->screen_h, &layer->canvas->bgcolor); + } + layer->banner_patched = 0; layer->refresh = 1; + } void conference_video_reset_layer(mcu_layer_t *layer) @@ -641,8 +645,7 @@ void conference_video_detach_video_layer(conference_member_t *member) switch_mutex_lock(canvas->mutex); if (member->video_layer_id < 0) { - switch_mutex_unlock(canvas->mutex); - return; + goto end; } layer = &canvas->layers[member->video_layer_id]; @@ -676,6 +679,8 @@ void conference_video_detach_video_layer(conference_member_t *member) conference_video_set_canvas_bgimg(canvas, NULL); } + end: + switch_mutex_unlock(canvas->mutex); conference_video_release_canvas(&canvas);