Skip to content

Commit 697e626

Browse files
committed
valgrind runs on ojph_expand in WSL
1 parent d1c4765 commit 697e626

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

src/apps/CMakeLists.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ if( OJPH_ENABLE_TIFF_SUPPORT )
1515
"or disable TIFF support using -DOJPH_ENABLE_TIFF_SUPPORT=OFF.")
1616
endif( TIFF_FOUND )
1717

18+
if(TIFF_FOUND)
19+
message(STATUS " TIFF_INCLUDE_DIR = ${TIFF_INCLUDE_DIR}")
20+
message(STATUS " TIFF_INCLUDE_DIRS = ${TIFF_INCLUDE_DIRS}")
21+
message(STATUS " TIFF_LIBRARY = ${TIFF_LIBRARY}")
22+
message(STATUS " TIFF_LIBRARIES = ${TIFF_LIBRARIES}")
23+
endif(TIFF_FOUND)
24+
1825
endif(OJPH_ENABLE_TIFF_SUPPORT)
1926
############################################################
2027

@@ -52,7 +59,8 @@ if( OJPH_ENABLE_OPENEXR_SUPPORT )
5259
# "or disable OpenEXR support using -DOJPH_ENABLE_OPENEXR_SUPPORT=OFF.")
5360
# endif( OpenEXR_FOUND )
5461

55-
find_package(OpenEXR 3 CONFIG QUIET)
62+
#find_package(OpenEXR 3 CONFIG QUIET)
63+
find_package(OpenEXR 3 QUIET)
5664
if(OpenEXR_FOUND)
5765
message(STATUS "Found OpenEXR ${OpenEXR_VERSION}")
5866
set(USE_OPENEXR TRUE CACHE BOOL "Add OpenEXR support")
@@ -85,6 +93,14 @@ if( OJPH_ENABLE_OPENEXR_SUPPORT )
8593

8694
endif(OpenEXR_FOUND)
8795

96+
if(OpenEXR_FOUND)
97+
message(STATUS " OpenEXR_VERSION = ${OpenEXR_VERSION}")
98+
message(STATUS " OpenEXR_INCLUDE_DIR = ${OpenEXR_INCLUDE_DIR}")
99+
message(STATUS " OpenEXR_INCLUDE_DIRS = ${OpenEXR_INCLUDE_DIRS}")
100+
message(STATUS " OpenEXR_LIBRARY = ${OpenEXR_LIBRARY}")
101+
message(STATUS " OpenEXR_LIBRARIES = ${OpenEXR_LIBRARIES}")
102+
endif(OpenEXR_FOUND)
103+
88104
endif(OJPH_ENABLE_OPENEXR_SUPPORT)
89105
############################################################
90106

src/apps/common/ojph_img_io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ namespace ojph {
932932
}
933933

934934
void open(const char* filename);
935-
void configure(ui32 width, ui32 height, ui32 num_components, bool* has_nlt, ui8* bitdepths, bool* is_signed);
935+
void configure(ui32 width, ui32 height, ui32 num_components, bool* has_nlt, ui32* bitdepths, bool* is_signed);
936936
virtual ui32 write(const line_buf* line, ui32 comp_num);
937937
virtual void close();
938938

src/apps/ojph_expand/ojph_expand.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ int main(int argc, char *argv[]) {
402402
ojph::param_nlt nlt = codestream.access_nlt();
403403
ojph::ui32 num_components = siz.get_num_components();
404404

405-
ojph::ui8 *bitdepths = (ojph::ui8*)calloc(num_components, sizeof(ojph::ui8));
405+
ojph::ui32 *bitdepths = (ojph::ui32*)calloc(num_components, sizeof(ojph::ui32));
406406
if (NULL == bitdepths) {
407-
fprintf(stderr, "Unable to allocate %zd bytes for bitdepths", num_components * sizeof(ojph::ui8));
407+
fprintf(stderr, "Unable to allocate %zd bytes for bitdepths", num_components * sizeof(ojph::ui32));
408408
exit(-1);
409409
}
410410

@@ -430,7 +430,7 @@ int main(int argc, char *argv[]) {
430430
c, has_nlt[c] ? "true" : "false");
431431
if (true == has_nlt[c])
432432
{
433-
fprintf(stderr, "nlt_bit_depth = %d nlt_is_signed = % s\n",
433+
fprintf(stderr, "nlt_bit_depth = %d nlt_is_signed = %s\n",
434434
nlt_bit_depth,
435435
nlt_is_signed ? "true" : "false");
436436
}

src/apps/others/ojph_img_io.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,11 +2266,11 @@ namespace ojph {
22662266
rgba_input_file = new Imf::RgbaInputFile(filename);
22672267
data_window = rgba_input_file->dataWindow();
22682268
int width = data_window.max.x - data_window.min.x + 1;
2269-
int height = data_window.max.y - data_window.min.y + 1;
22702269

22712270
// reserve memory for 1 scanline
22722271
pixels.resizeErase(1, width);
22732272
// reserve memory for the whole image
2273+
//int height = data_window.max.y - data_window.min.y + 1;
22742274
//pixels.resizeErase(height, width);
22752275

22762276
}
@@ -2384,7 +2384,7 @@ namespace ojph {
23842384
return;
23852385
}
23862386

2387-
void exr_out::configure(ui32 width, ui32 height, ui32 num_components, bool *has_nlt, ui8 *bitdepths, bool* is_signed)
2387+
void exr_out::configure(ui32 width, ui32 height, ui32 num_components, bool *has_nlt, ui32 *bitdepths, bool* is_signed)
23882388
{
23892389
this->num_components = num_components;
23902390
this->width = width;

tests/run_valgrind_ojph_expand.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
set -x
44
set -u
55

6-
PATH_TO_EXECUTABLE="../bin/"
7-
INPUT_FILENAME="SPARKS_ACES_06822.exr.reversible-true.colour-transf-false.j2c"
8-
OUTPUT_FILENAME="SPARKS_ACES_06822.exr.reversible-true.colour-transf-false.j2c.exr"
6+
PATH_TO_EXECUTABLE="../build/src/apps/ojph_expand/ojph_expand"
7+
#INPUT_FILENAME="/tmp/SPARKS_ACES_06822.exr.reversible-true.colour-transf-true.j2c"
8+
#OUTPUT_FILENAME="/tmp/SPARKS_ACES_06822.exr.reversible-true.colour-transf-true.j2c.exr"
9+
INPUT_FILENAME="/tmp/SPARKS_ACES_06822.exr.reversible-true.colour-transf-false.j2c"
10+
OUTPUT_FILENAME="/tmp/SPARKS_ACES_06822.exr.reversible-true.colour-transf-false.j2c.exr"
911
ADDITIONAL_COMMAND_LINE_OPTIONS=""
1012

1113
valgrind -s --error-exitcode=1 --leak-check=full --track-origins=yes --show-leak-kinds=all ${PATH_TO_EXECUTABLE} -i ${INPUT_FILENAME} -o ${OUTPUT_FILENAME} ${ADDITIONAL_COMMAND_LINE_OPTIONS}

0 commit comments

Comments
 (0)