From cf39e9c5ae7a09f1a4a290bf5c5d3d07b8709124 Mon Sep 17 00:00:00 2001 From: Mike Jerris Date: Thu, 6 Apr 2017 18:03:54 -0500 Subject: [PATCH] FS-10213: [mod_conference] fix crash in video scaling to layer in case of rounding error --- src/mod/applications/mod_conference/conference_video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mod/applications/mod_conference/conference_video.c b/src/mod/applications/mod_conference/conference_video.c index c86c6db2bf..ddf1bd5ed8 100644 --- a/src/mod/applications/mod_conference/conference_video.c +++ b/src/mod/applications/mod_conference/conference_video.c @@ -769,7 +769,10 @@ void conference_video_scale_and_patch(mcu_layer_t *layer, switch_image_t *ximg, //printf("B4 %dx%d %dx%d\n", crop_w, crop_h, layer->crop_w, layer->crop_h); set_pan(crop_w, &layer->crop_w, layer->cam_opts.zoom_accel_speed, layer->cam_opts.zoom_accel_min, layer->cam_opts.zoom_speed); + if (layer->crop_w > img->d_w) layer->crop_w = img->d_w; + layer->crop_h = layer->crop_w / screen_aspect; + if (layer->crop_h > img->d_h) layer->crop_h = img->d_h; set_bounds(&layer->crop_x, &layer->crop_y, img->d_w, img->d_h, layer->crop_w, layer->crop_h);