From: Mike Jerris Date: Thu, 6 Apr 2017 23:03:54 +0000 (-0500) Subject: FS-10213: [mod_conference] fix crash in video scaling to layer in case of rounding... X-Git-Tag: v1.8.0~626 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf39e9c5ae7a09f1a4a290bf5c5d3d07b8709124;p=thirdparty%2Ffreeswitch.git FS-10213: [mod_conference] fix crash in video scaling to layer in case of rounding error --- 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);