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
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user