Skip to content

fix segfault when CONVERT_RGB is disabled with V4L backend - #14036

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
jveitchmichaelis:Y16_v4l_fix
Mar 12, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
jveitchmichaelis:Y16_v4l_fix

Conversation

@jveitchmichaelis

Copy link
Copy Markdown
Contributor

resolves #13697

This pullrequest changes

Fixes a bug where CAP_V4L would segfault after releasing a capture device. The error seemed to be caused by a frame not being released properly when CONVERT_RGB is disabled. Possibly it was marked as allocated when it wasn't, and then the segfault occurs when the destructor gets called.

I've tested switching between modes (before releasing the camera) and it works without any errors.

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

As a "bugfix" this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

Comment thread modules/videoio/src/cap_v4l.cpp Resolved
@jveitchmichaelis
jveitchmichaelis changed the base branch from master to 3.4 March 12, 2019 12:41
@jveitchmichaelis
jveitchmichaelis changed the base branch from 3.4 to master March 12, 2019 12:41
@jveitchmichaelis
jveitchmichaelis changed the base branch from master to 3.4 March 12, 2019 12:42
@jveitchmichaelis

Copy link
Copy Markdown
Contributor Author

Ok, no problem, I've rebased to 3.4.

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit 2143f7c into opencv:3.4 Mar 12, 2019
@alalek alalek mentioned this pull request Mar 13, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
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.

3 participants