浏览代码

libobs: Prevent setting invalid scene item scale values

Fixes obsproject/obs-studio#7962
Jim 2 年之前
父节点
当前提交
40f7c7923c
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      libobs/obs-scene.c

+ 3 - 1
libobs/obs-scene.c

@@ -2732,7 +2732,9 @@ void obs_sceneitem_set_info(obs_sceneitem_t *item,
 	if (item && info) {
 	if (item && info) {
 		item->pos = info->pos;
 		item->pos = info->pos;
 		item->rot = info->rot;
 		item->rot = info->rot;
-		item->scale = info->scale;
+		if (isfinite(info->scale.x) && isfinite(info->scale.y)) {
+			item->scale = info->scale;
+		}
 		item->align = info->alignment;
 		item->align = info->alignment;
 		item->bounds_type = info->bounds_type;
 		item->bounds_type = info->bounds_type;
 		item->bounds_align = info->bounds_alignment;
 		item->bounds_align = info->bounds_alignment;