summaryrefslogtreecommitdiff
path: root/codec
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2007-09-06 16:49:15 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2007-09-06 16:49:15 +0000
commit53471a76f1291ce607ee48bea158dbebe871ef3a (patch)
treeccaf3da4b56948f198eb380bd56a4b9e67ad34c8 /codec
parent8ac5e7023c18f589f8be996e0ce1304012d22499 (diff)
ENH: Fix unitialized read in img_fol (we may need a smarter initialize than memset)
Diffstat (limited to 'codec')
-rw-r--r--codec/CMakeLists.txt2
-rw-r--r--codec/image_to_j2k.c3
-rw-r--r--codec/j2k_to_image.c2
3 files changed, 6 insertions, 1 deletions
diff --git a/codec/CMakeLists.txt b/codec/CMakeLists.txt
index a381840c..363c8fd8 100644
--- a/codec/CMakeLists.txt
+++ b/codec/CMakeLists.txt
@@ -42,7 +42,7 @@ FIND_PACKAGE(TIFF REQUIRED)
FOREACH(exe j2k_to_image image_to_j2k)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg ${TIFF_LIBRARIES})
- ADD_TEST(${exe} ${exe})
+ ADD_TEST(${exe} ${EXECUTABLE_OUTPUT_PATH}/${exe})
# On unix you need to link to the math library:
IF(UNIX)
TARGET_LINK_LIBRARIES(${exe} m)
diff --git a/codec/image_to_j2k.c b/codec/image_to_j2k.c
index c921e215..cbb9d0bc 100644
--- a/codec/image_to_j2k.c
+++ b/codec/image_to_j2k.c
@@ -1745,6 +1745,9 @@ int main(int argc, char **argv) {
/* set encoding parameters to default values */
opj_set_default_encoder_parameters(&parameters);
+ /* need to initialize img_fol since parameters will be read in parse_cmdline_decoder */
+ memset(&img_fol,0,sizeof(img_fol_t));
+
/* parse input and get user encoding parameters */
if(parse_cmdline_encoder(argc, argv, &parameters,&img_fol, &raw_cp) == 1) {
return 0;
diff --git a/codec/j2k_to_image.c b/codec/j2k_to_image.c
index f0584554..ee774166 100644
--- a/codec/j2k_to_image.c
+++ b/codec/j2k_to_image.c
@@ -517,6 +517,8 @@ int main(int argc, char **argv) {
/* set decoding parameters to default values */
opj_set_default_decoder_parameters(&parameters);
+ /* need to initialize img_fol since parameters will be read in parse_cmdline_decoder */
+ memset(&img_fol,0,sizeof(img_fol_t));
/* parse input and get user encoding parameters */
if(parse_cmdline_decoder(argc, argv, &parameters,&img_fol) == 1) {