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

revert: tiff2imag method ,part of commit 5d9b930de5472e933d5260837569… #2205

Merged
merged 5 commits into from
Feb 26, 2025

Conversation

xiaoyifang
Copy link
Owner

fix #2202

src/tiff.cc Outdated
Comment on lines 26 to 27
memcpy( data.data(), ba.data(), ba.size() );
data.resize( ba.size() );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't revert anything else except swap the order of those 2 lines.

QBuffer control the content of the QByteArray ba. The original code involves an implicit conversion QByteaArray->char*.

Also, &std::vector::front is a crash if the vector is empty. It generally shouldn't occur in post-c++11 code.

@xiaoyifang xiaoyifang enabled auto-merge (squash) February 26, 2025 15:48
@shenlebantongying
Copy link
Collaborator

Thanks.

@xiaoyifang xiaoyifang merged commit 4d9105c into staged Feb 26, 2025
10 checks passed
@xiaoyifang xiaoyifang deleted the fix/crash-tiff branch February 26, 2025 15:57
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.

The last two versions of MacOS have frequently reported errors.
2 participants