[trunk] Fix sscanf format specifier (fixes issue 494)

Thanks Aaron.
This commit is contained in:
Matthieu Darbois 2015-05-28 22:16:49 +00:00
parent e3291c4e1f
commit 73881d0e52
2 changed files with 5 additions and 5 deletions

View File

@ -699,7 +699,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
OPJ_UINT32 numlayers = 0, numresolution = 0, matrix_width = 0;
char *s = opj_optarg;
sscanf(s, "%ud", &numlayers);
sscanf(s, "%u", &numlayers);
s++;
if (numlayers > 9)
s++;
@ -871,7 +871,7 @@ static int parse_cmdline_encoder(int argc, char **argv, opj_cparameters_t *param
char *s = opj_optarg;
POC = parameters->POC;
while (sscanf(s, "T%ud=%ud,%ud,%ud,%ud,%ud,%4s", &POC[numpocs].tile,
while (sscanf(s, "T%u=%u,%u,%u,%u,%u,%4s", &POC[numpocs].tile,
&POC[numpocs].resno0, &POC[numpocs].compno0,
&POC[numpocs].layno1, &POC[numpocs].resno1,
&POC[numpocs].compno1, POC[numpocs].progorder) == 7) {

View File

@ -629,7 +629,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_decompress_parameters *para
case 'r': /* reduce option */
{
sscanf(opj_optarg, "%ud", &(parameters->core.cp_reduce));
sscanf(opj_optarg, "%u", &(parameters->core.cp_reduce));
}
break;
@ -638,7 +638,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_decompress_parameters *para
case 'l': /* layering option */
{
sscanf(opj_optarg, "%ud", &(parameters->core.cp_layer));
sscanf(opj_optarg, "%u", &(parameters->core.cp_layer));
}
break;
@ -678,7 +678,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_decompress_parameters *para
case 't': /* Input tile index */
{
sscanf(opj_optarg, "%ud", &parameters->tile_index);
sscanf(opj_optarg, "%u", &parameters->tile_index);
parameters->nb_tile_to_decode = 1;
}
break;