From 6cd441e6d2e3b5f8ce350fceb98071480b353825 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 24 Jan 2025 23:12:29 -0800 Subject: [PATCH] fix codeql issues 22-27, types now match in loop condition --- ctlrender/tiff_file.cc | 13 +++++++------ ctlrender/transform.cc | 7 ++++--- lib/dpx/dpx_rw.cc | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ctlrender/tiff_file.cc b/ctlrender/tiff_file.cc index 506b087..9fa1723 100644 --- a/ctlrender/tiff_file.cc +++ b/ctlrender/tiff_file.cc @@ -278,6 +278,7 @@ void tiff_read_multiplane(TIFF *t, float scale, ctl::dpx::fb * pixels) { uint32_t row; uint32_t orientation_offset; uint16_t d; + uint32_t e; TIFFGetFieldDefaulted(t, TIFFTAG_IMAGEWIDTH, &w); TIFFGetFieldDefaulted(t, TIFFTAG_IMAGELENGTH, &h); @@ -300,8 +301,8 @@ void tiff_read_multiplane(TIFF *t, float scale, ctl::dpx::fb * pixels) { for(row=0; row<4; row++) { if(row * pixels) { for(row=0; row<4; row++) { if(row * pixels) { for(row=0; row<4; row++) { if(row image_buffer; @@ -807,11 +808,11 @@ void transform(const char *inputFile, const char *outputFile, char name[16]; - for (i = 4; i < image_buffer.depth(); i++) + for (j = 4; j < image_buffer.depth(); j++) { memset(name, 0, sizeof(name)); - snprintf(name, sizeof(name) - 1, "c%02dIn", i); - ctl_results.push_back(mkresult(name, NULL, image_buffer, i)); + snprintf(name, sizeof(name) - 1, "c%02dIn", j); + ctl_results.push_back(mkresult(name, NULL, image_buffer, j)); } for (operations_iter = ctl_operations.begin(); operations_iter != ctl_operations.end(); operations_iter++) diff --git a/lib/dpx/dpx_rw.cc b/lib/dpx/dpx_rw.cc index 7d9e9b5..80fbddf 100644 --- a/lib/dpx/dpx_rw.cc +++ b/lib/dpx/dpx_rw.cc @@ -268,7 +268,7 @@ void rwinfo::write_init(std::ostream *o, dpx *h) { } void rwinfo::find_home(dpx *h, uint8_t element, uint64_t size) { - uint8_t i; + uint16_t i; rwinfo info; uint64_t eof; uint64_t actual_eof;