-
Notifications
You must be signed in to change notification settings - Fork 11
Fix CVEs #38
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
base: master
Are you sure you want to change the base?
Fix CVEs #38
Conversation
7bf14dd to
639c22e
Compare
| throw FI_MSG_ERROR_DIB_MEMORY; | ||
| } | ||
|
|
||
| if (cinfo.image_width > JPEG_MAX_DIMENSION || cinfo.image_height > JPEG_MAX_DIMENSION) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)
Partially Fix : #37