Skip to content
Permalink
Browse files

pgxtoimage(): fix write stack buffer overflow (#997)

  • Loading branch information...
rouault committed Aug 18, 2017
1 parent 5597522 commit e5285319229a5d77bf316bb0d3a6cbd3cb8666d9
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/bin/jp2/convert.c
@@ -1185,7 +1185,7 @@ opj_image_t* pgxtoimage(const char *filename, opj_cparameters_t *parameters)
}

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) {
fclose(f);
fprintf(stderr,

0 comments on commit e528531

Please sign in to comment.
You can’t perform that action at this time.