diff options
| author | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-01-30 10:51:29 +0000 |
|---|---|---|
| committer | Francois-Olivier Devaux <fodevaux@users.noreply.github.com> | 2007-01-30 10:51:29 +0000 |
| commit | a6d737721317691cdec1bb078eca8c93a7313379 (patch) | |
| tree | 79a968921fbb47ddd66e7f4566b91aade24f6569 /codec | |
| parent | d48feb45fc7427e578b95c8844814e23d1999dac (diff) | |
Use of OPJ_PATH_LEN (defined as 4096) to be the maximum allowed size for filenames instead of MAX_PATH which is not always defined. This caused some programs using OpenJPEG to crash. Modifications in openjpeg.h j2k_to_image.c and image_to_j2k.c
Diffstat (limited to 'codec')
| -rw-r--r-- | codec/image_to_j2k.c | 8 | ||||
| -rw-r--r-- | codec/j2k_to_image.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/codec/image_to_j2k.c b/codec/image_to_j2k.c index 14d0182a..4ecf0df1 100644 --- a/codec/image_to_j2k.c +++ b/codec/image_to_j2k.c @@ -332,7 +332,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters) infile); return 1; } - strncpy(parameters->infile, infile, MAX_PATH); + strncpy(parameters->infile, infile, OPJ_PATH_LEN); } break; @@ -350,7 +350,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters) fprintf(stderr, "Unknown output format image %s [only *.j2k, *.jp2]!! \n", outfile); return 1; } - strncpy(parameters->outfile, outfile, MAX_PATH); + strncpy(parameters->outfile, outfile, OPJ_PATH_LEN); } break; @@ -498,7 +498,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters) case 'x': /* creation of index file */ { char *index = optarg; - strncpy(parameters->index, index, MAX_PATH); + strncpy(parameters->index, index, OPJ_PATH_LEN); parameters->index_on = 1; } break; @@ -668,7 +668,7 @@ int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *parameters) /* we need to enable indexing */ if (!parameters->index_on) { - strncpy(parameters->index, JPWL_PRIVATEINDEX_NAME, MAX_PATH); + strncpy(parameters->index, JPWL_PRIVATEINDEX_NAME, OPJ_PATH_LEN); parameters->index_on = 1; } diff --git a/codec/j2k_to_image.c b/codec/j2k_to_image.c index d40a2949..7a75b8d1 100644 --- a/codec/j2k_to_image.c +++ b/codec/j2k_to_image.c @@ -153,7 +153,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters) infile); return 1; } - strncpy(parameters->infile, infile, MAX_PATH); + strncpy(parameters->infile, infile, OPJ_PATH_LEN); } break; @@ -172,7 +172,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters) fprintf(stderr, "Unknown output format image %s [only *.pnm, *.pgm, *.ppm, *.pgx or *.bmp]!! \n", outfile); return 1; } - strncpy(parameters->outfile, outfile, MAX_PATH); + strncpy(parameters->outfile, outfile, OPJ_PATH_LEN); } break; |
