Skip to content

If realloc fails, do not reduce block size#9702

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:realloc
Jun 22, 2026
Merged

If realloc fails, do not reduce block size#9702
radarhere merged 1 commit into
python-pillow:mainfrom
radarhere:realloc

Conversation

@radarhere

@radarhere radarhere commented Jun 21, 2026

Copy link
Copy Markdown
Member

Within this code, it is possible for realloc to fail.

// Reduce block size
if (block.size > arena->block_size) {
block.size = arena->block_size;
block.ptr = realloc(block.ptr, arena->block_size);
}

This doesn't have to trigger an error though. We can simply avoid reducing the block size.

@radarhere radarhere merged commit cffaa1e into python-pillow:main Jun 22, 2026
53 of 54 checks passed
@radarhere radarhere deleted the realloc branch June 22, 2026 06:45
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.

1 participant