FS-7513: prevent null layer img

This commit is contained in:
Anthony Minessale 2015-04-20 11:04:36 -05:00 committed by Michael Jerris
parent 70198e0d28
commit e5dae7e602

View File

@ -1044,6 +1044,8 @@ static void scale_and_patch(conference_obj_t *conference, mcu_layer_t *layer, sw
IMG = conference->canvas->img; IMG = conference->canvas->img;
img = ximg ? ximg : layer->cur_img; img = ximg ? ximg : layer->cur_img;
switch_assert(IMG && img);
if (layer->refresh) { if (layer->refresh) {
switch_rgb_color_t color; switch_rgb_color_t color;
switch_color_set_rgb(&color, conference->video_layout_bgcolor); switch_color_set_rgb(&color, conference->video_layout_bgcolor);
@ -2002,17 +2004,20 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
if (img != imember->avatar_png_img) { if (img != imember->avatar_png_img) {
switch_img_free(&img); switch_img_free(&img);
} }
} else {
layer->cur_img = img;
} }
if (img && !layer->cur_img) {
layer->cur_img = img;
}
img = NULL; img = NULL;
layer->tagged = 1; layer->tagged = 1;
} }
} }
switch_mutex_unlock(conference->canvas->mutex); switch_mutex_unlock(conference->canvas->mutex);
if (img && img != imember->avatar_png_img) { if (img && img != imember->avatar_png_img) {
switch_img_free(&img); switch_img_free(&img);
} }
@ -2045,8 +2050,10 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
layer->refresh = 1; layer->refresh = 1;
conference->canvas->refresh++; conference->canvas->refresh++;
} }
scale_and_patch(conference, layer, NULL, SWITCH_FALSE); if (layer->cur_img) {
scale_and_patch(conference, layer, NULL, SWITCH_FALSE);
}
layer->tagged = 0; layer->tagged = 0;
} }
} }