[trunk] Remove out of bound access in code and simplify code. this is a test tool, security is not an issue here.
This commit is contained in:
parent
8d3ef0729c
commit
8a959bb1f4
|
@ -152,8 +152,7 @@ static opj_image_t* readImageFromFileTIF(const char* filename, int nbFilenamePGX
|
||||||
/* set encoding parameters to default values */
|
/* set encoding parameters to default values */
|
||||||
opj_set_default_encoder_parameters(¶meters);
|
opj_set_default_encoder_parameters(¶meters);
|
||||||
parameters.decod_format = TIF_DFMT;
|
parameters.decod_format = TIF_DFMT;
|
||||||
strncpy(parameters.infile, filename, sizeof(parameters.infile)-1);
|
strcpy(parameters.infile, filename);
|
||||||
assert( parameters.infile[sizeof(parameters.infile)] == 0 );
|
|
||||||
|
|
||||||
/* Allocate memory*/
|
/* Allocate memory*/
|
||||||
param_image_read = malloc(nbFilenamePGX * sizeof(opj_image_cmptparm_t));
|
param_image_read = malloc(nbFilenamePGX * sizeof(opj_image_cmptparm_t));
|
||||||
|
|
Loading…
Reference in New Issue