Skip to content

Commit

Permalink
This address one more warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
aous72 committed Sep 20, 2024
1 parent b6ddad9 commit 1580ae7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/apps/common/ojph_img_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ namespace ojph {
FILE *fh;
const char *fname;
float* buffer;
ui32 buffer_size;
size_t buffer_size;
ui32 width, height, num_components;
float scale;
ui32 bit_depth[3];
Expand Down
2 changes: 1 addition & 1 deletion src/apps/others/ojph_img_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ namespace ojph {
OJPH_ERROR(0x03000061, "Error seeking in file %s", fname);
}
size_t result =
fread(temp_buf, sizeof(float), num_comps * (size_t)width, fh);
fread(temp_buf, sizeof(float), (size_t)num_comps * (size_t)width, fh);
if (result != num_comps * width)

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type High

Multiplication result may overflow 'unsigned int' before it is converted to 'unsigned long'.
{
close();
Expand Down

0 comments on commit 1580ae7

Please sign in to comment.