Skip to content

Commit dd011ac

Browse files
committed
Addresses a couple of warnings.
1 parent bca572f commit dd011ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/apps/common/ojph_img_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ namespace ojph {
683683
ui32 bit_depth_of_data[4];
684684
ui32 bytes_per_sample;
685685
ui8* buffer;
686-
ui32 buffer_size;
686+
size_t buffer_size;
687687
ui32 cur_line, samples_per_line;
688688
};
689689
#endif /* OJPH_ENABLE_TIFF_SUPPORT */

src/apps/others/ojph_img_io.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ namespace ojph {
10701070
OJPH_ERROR(0x030000B3, "unable to open file %s for writing", filename);
10711071
}
10721072

1073-
buffer_size = (size_t)width * num_components * (size_t)bytes_per_sample;
1073+
buffer_size = width * (size_t)num_components * (size_t)bytes_per_sample;
10741074
buffer = (ui8*)malloc(buffer_size);
10751075
fname = filename;
10761076
cur_line = 0;
@@ -1626,7 +1626,7 @@ namespace ojph {
16261626
}
16271627

16281628
bytes_per_sample = (bit_depth + 7) >> 3;
1629-
buffer_size = (size_t)width * bytes_per_sample;
1629+
buffer_size = width * bytes_per_sample;
16301630
buffer = (ui8*)malloc(buffer_size);
16311631
}
16321632

0 commit comments

Comments
 (0)