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

Handle default value for RowsPerStrip TIFF tag #5358

Closed

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Mar 24, 2021

Resolves #5319

For the RowsPerStrip TIFF tag, https://www.awaresystems.be/imaging/tiff/tifftags/rowsperstrip.html

The default is 2**32 - 1, which is effectively infinity. That is, the entire image is one strip.

However, if RowsPerStrip is too large, we reject this as an error.

/* overflow check for realloc */
if (INT_MAX / row_byte_size < rows_per_strip) {
state->errcode = IMAGING_CODEC_MEMORY;
return -1;
}

So this PR makes an allowance for that specific value.

The test image comes from the issue.

@radarhere radarhere added the TIFF label Mar 24, 2021
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

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

This has a conflict.

@radarhere
Copy link
Member Author

That's not really a conflict - it's the same change! This has been replaced by #5364

@radarhere radarhere closed this Mar 28, 2021
@radarhere radarhere deleted the default_rowsperstrip branch March 28, 2021 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"OSError: -9" saving a multi-layer TIFF via libtiff
2 participants