Skip to content

Conversation

@liberodark
Copy link

@liberodark liberodark commented Dec 2, 2025

@liberodark liberodark force-pushed the CVE branch 4 times, most recently from 7bf14dd to 639c22e Compare December 2, 2025 21:52
@liberodark liberodark marked this pull request as ready for review December 2, 2025 21:57
throw FI_MSG_ERROR_DIB_MEMORY;
}

if (cinfo.image_width > JPEG_MAX_DIMENSION || cinfo.image_height > JPEG_MAX_DIMENSION) {
Copy link
Contributor

@lordnn lordnn Dec 4, 2025

Choose a reason for hiding this comment

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

What's the difference from the if condition above?

const int height = bmih.biHeight / 2; // height == xor + and mask
const unsigned bit_count = bmih.biBitCount;
if (bit_count != 1 && bit_count != 2 && bit_count != 4 && bit_count != 8 && bit_count != 16 && bit_count != 24 && bit_count != 32) {
return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

nullptr

FreeImage_OutputMessageProc(s_format_id,
"Unable to handle this format: bitspersample = 8, TIFFTAG_PLANARCONFIG = PLANARCONFIG_SEPARATE"
);
throw (char*)NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

nullptr

const uint32_t imageRowSize = (uint32_t)TIFFScanlineSize(tif);

if (width / tileWidth * tileRowSize * 8 > bitspersample * samplesperpixel * width) {
free(tileBuffer);
Copy link
Contributor

Choose a reason for hiding this comment

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

free(std::unique_ptr<uint8_t[]>)???

const uint32_t tileRowSize = (uint32_t)TIFFTileRowSize(tif);
const uint32_t imageRowSize = (uint32_t)TIFFScanlineSize(tif);

if (width / tileWidth * tileRowSize * 8 > bitspersample * samplesperpixel * width) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think more correct condition is if (width / tileWidth * tileRowSize > dst_pitch)

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.

CVE of Freeimage

2 participants