[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:
Mathieu Malaterre 2014-03-06 14:50:42 +00:00
parent 8d3ef0729c
commit 8a959bb1f4
1 changed files with 1 additions and 2 deletions

View File

@ -152,8 +152,7 @@ static opj_image_t* readImageFromFileTIF(const char* filename, int nbFilenamePGX
/* set encoding parameters to default values */
opj_set_default_encoder_parameters(&parameters);
parameters.decod_format = TIF_DFMT;
strncpy(parameters.infile, filename, sizeof(parameters.infile)-1);
assert( parameters.infile[sizeof(parameters.infile)] == 0 );
strcpy(parameters.infile, filename);
/* Allocate memory*/
param_image_read = malloc(nbFilenamePGX * sizeof(opj_image_cmptparm_t));