Skip to content

fix videoio/src/container_avi.cpp VideoInputStream alignment crashes on 32bit arm (android)#20373

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
kikaxa:mjpeg-VideoInputStream-alignment-fix
Jul 7, 2021
Merged

fix videoio/src/container_avi.cpp VideoInputStream alignment crashes on 32bit arm (android)#20373
opencv-pushbot merged 1 commit intoopencv:3.4from
kikaxa:mjpeg-VideoInputStream-alignment-fix

Conversation

@kikaxa
Copy link
Copy Markdown
Contributor

@kikaxa kikaxa commented Jul 7, 2021

In #10145 refactoring VideoInputStream was misplaced inside #pragma pack block resulting in broken std::string alignment = crashes on 32bit arm.

To reproduce we must hit cap_mjpeg_decoder.cpp:

cv::VideoCapture icap;
icap.open("anyfile.mp4");

crash in VideoInputStream::m_fname std::string ctor.

Existing videoio tests should catch this crash, but none of the arm32 builders run videoio tests.
I don't have an opencv test setup for arm32, is there any way to enable and run videoio tests on the CI?

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@kikaxa
Copy link
Copy Markdown
Contributor Author

kikaxa commented Jul 7, 2021

Tagging @mshabunin @allnes from original PR, @alalek as the only person i know for the CI/tests part..
Sorry if this is not appropriate, i don't know a better way to find/mention the most interested parties.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Nice catch!
Thank you 👍

@opencv-pushbot opencv-pushbot merged commit 4788de7 into opencv:3.4 Jul 7, 2021
@kikaxa kikaxa deleted the mjpeg-VideoInputStream-alignment-fix branch July 7, 2021 18:36
@alalek alalek mentioned this pull request Jul 10, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
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