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

Prevent frame going out of scope when converting RGB -> BGR #288

Merged
merged 1 commit into from Dec 7, 2018

Conversation

sgvandijk
Copy link
Contributor

In showimage, when an image is encoded in RGB, it is converted into a BGR image. However, the converted frame is deallocated when the cv:Mat referencing it, frame2, goes out of scope, resulting in a segmentation fault when trying to show it.

This PR fixes this by reusing the original cv::Mat in cv::cvtColor, which is safe, and stays in scope until the end of the function.

@tfoote tfoote added the in review Waiting for review (Kanban column) label Dec 1, 2018
@wjwwood
Copy link
Member

wjwwood commented Dec 6, 2018

Thanks @sgvandijk! Here's CI and I'll merge if those come back greed:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@wjwwood wjwwood merged commit 855e99f into ros2:master Dec 7, 2018
@wjwwood wjwwood removed the in review Waiting for review (Kanban column) label Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants