-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix CodeQL reports on crunch and crnlib #60
base: master
Are you sure you want to change the base?
Changes from all commits
ce3a222
b95e047
277eb5a
b5f707f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -570,9 +570,9 @@ bool resample_multithreaded(const image_u8& src, image_u8& dst, const resample_p | |
return false; | ||
|
||
p.m_pSrc_pixels = src_samples.get_ptr(); | ||
p.m_src_pitch = src_width * resampler_comps * sizeof(float); | ||
p.m_src_pitch = (size_t)src_width * (size_t)resampler_comps * sizeof(float); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Crunch has a maximum image dimension of 4096 so we don't ever need to worry about super-sized memory allocations. |
||
p.m_pDst_pixels = dst_samples.get_ptr(); | ||
p.m_dst_pitch = dst_width * resampler_comps * sizeof(float); | ||
p.m_dst_pitch = (size_t)dst_width * (size_t)resampler_comps * sizeof(float); | ||
|
||
for (uint src_y = 0; src_y < src_height; src_y++) { | ||
const color_quad_u8* pSrc = src.get_scanline(src_y); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -958,7 +958,7 @@ class crunch { | |
else { | ||
console::info("CRN texture info:"); | ||
|
||
console::info("Width: %u, Height: %u, Levels: %u, Faces: %u\nBytes per block: %u, User0: 0x%08X, User1: 0x%08X, CRN Format: %u", | ||
console::info("Width: %u, Height: %u, Levels: %u, Faces: %u\nBytes per block: %u, User0: 0x%08X, User1: 0x%08X, CRN Format: %l", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one doesn't quite fix the issue... apparently the crn_format enum, having both a -1 value and a 2^32 - 1 value, is a different size depending on the compiler. In MSVC it is 32 bits but in some others it must be 64. We could force it to be a specific type with the C++11 feature |
||
tex_info.m_width, | ||
tex_info.m_height, | ||
tex_info.m_levels, | ||
|
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.
Can we just disable float/double precision warnings please? It simply doesn't matter. This is a lossy image compression program.
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.
This is CodeQL static analysis report, not a compiler warning.
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 know that. It should be configurable.