Ver código fonte

libobs: Fix crop values for new nested scene sources being incorrect

derrod 1 ano atrás
pai
commit
5fea7d325e
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      libobs/obs-scene.c

+ 3 - 0
libobs/obs-scene.c

@@ -619,6 +619,9 @@ static inline void log_matrix(const struct matrix4 *mat, const char *name)
 static inline void update_nested_scene_crop(struct obs_scene_item *item,
 					    uint32_t width, uint32_t height)
 {
+	if (!item->last_height || !item->last_width)
+		return;
+
 	/* Use last size and new size to calculate factor to adjust crop by. */
 	float scale_x = (float)width / (float)item->last_width;
 	float scale_y = (float)height / (float)item->last_height;