pgxtoimage(): fix write stack buffer overflow (#997)
This commit is contained in:
parent
5597522cac
commit
e528531922
|
@ -1185,7 +1185,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters)
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek(f, 0, SEEK_SET);
|
fseek(f, 0, SEEK_SET);
|
||||||
if (fscanf(f, "PG%[ \t]%c%c%[ \t+-]%d%[ \t]%d%[ \t]%d", temp, &endian1,
|
if (fscanf(f, "PG%31[ \t]%c%c%31[ \t+-]%d%31[ \t]%d%31[ \t]%d", temp, &endian1,
|
||||||
&endian2, signtmp, &prec, temp, &w, temp, &h) != 9) {
|
&endian2, signtmp, &prec, temp, &w, temp, &h) != 9) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
Loading…
Reference in New Issue