]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10213: [mod_conference] fix crash in video scaling to layer in case of rounding...
authorMike Jerris <mike@jerris.com>
Thu, 6 Apr 2017 23:03:54 +0000 (18:03 -0500)
committerMike Jerris <mike@jerris.com>
Thu, 6 Apr 2017 23:03:54 +0000 (18:03 -0500)
src/mod/applications/mod_conference/conference_video.c

index c86c6db2bf9132186d39f3554f671c788c465714..ddf1bd5ed8dd906a10c2cc997d01af072a0ecdad 100644 (file)
@@ -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);