Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash caused by null parameter passed to CameraServer.add_feed() #47571

Merged
merged 1 commit into from
Apr 3, 2021
Merged

Conversation

lucicam
Copy link
Contributor

@lucicam lucicam commented Apr 2, 2021

Fixes #46181

CameraServer.add_feed() takes a CameraFeed object type as parameter.
Passing in another type of data while binding the method it will make
that parameter null.
Added a check for null which returns from function and does not make the
engine crash anymore.

Important note: the issue was for 3.x but I noticed in master this is also the case
and I know that it's best to pull request to master and then cherry pick to 3.x
(I will also do that one if this is merged). I was not able to test on master because
I can't run the engine compiled for master for some reason but the change is small
enough to not affect it in a bad way even if the issue is not reproducible in 4.0
(if someone could confirm the issue is still present there, that would be great).

Fixes #46181

CameraServer.add_feed() takes a CameraFeed object type as parameter.
Passing in another type of data while binding the method it will make
tha parameter null.
Added a check for null which returns from function and does not make the
engine crash anymore.
@lucicam lucicam requested a review from a team as a code owner April 2, 2021 14:39
@Calinou Calinou added this to the 4.0 milestone Apr 2, 2021
@akien-mga akien-mga merged commit 4a65e69 into godotengine:master Apr 3, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Executing CameraServer.add_feed(SkeletonIK.new()) crashes Godot
4 participants